Query / Pulling Out All Records That Contain Specific Text?

Nov 11, 2012

In the Owner Name field, I am looking for a way to pull out all estates. They are abbreviated with "EST" or "Estate". The problem is throughout the database, if you do a simple filter for "contains est" it will include names such as "Forester" or "LHB Investments".

How do I query, or filter this database such that it only returns the estates abbreviated with "EST" or "Estate"?

View Replies


ADVERTISEMENT

Pulling Specific Data For Specific Date Range

Jul 14, 2007

so i have an interesting question and im hoping that someone can help on this one. i need to pull date from a specific table, no problem, that's written and working fine, next i need to be able to join the data from another table by a primary key, again no problem. third, i need to be able to select the date (using WHERE) for a specific date range. (i.e. i enter the date range of 01/7/2007 to 15/7/2007) and the query comes back only showing the data from that specific time, not the data from before or after. this is where my problem lies, all the entered data is being shown after entering my date range. i am going to include my SQL statement, just so you can actually see what im really talking about.

SELECT srealest.Name0, srealest.Dist1, SREpayments.Face2Pd, SREpayments.Penalty2Pd, SREpayments.[2paid], SREpayments.Face3Pd, SREpayments.Penalty3Pd, SREpayments.[3paid], SREpayments.Face4Pd, SREpayments.Penalty4Pd, SREpayments.[4paid], srealest.Map, srealest.Parcel, srealest.LeaseHold, srealest.TaxRebate1, srealest.TaxFace1, srealest.TaxPenalty1, srealest.TaxYear, srealest.BillNo, srealest.PdRebate1, srealest.PdFace1, srealest.PdPenalty1, srealest.DatePd
FROM SREpayments INNER JOIN srealest ON SREpayments.BillNo=srealest.BillNo
WHERE (((SREpayments.[2paid]) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date]) Or ((SREpayments.[3paid]) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date]) Or ((SREpayments.[4paid]) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date])) Or (((srealest.DatePd) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date]))
ORDER BY srealest.Name0;


any thoughts or ideas on how to accomplish this would be greatly appreciated!

View 2 Replies View Related

Query Not Pulling Up Records

Sep 9, 2004

Hi

Apologies if this is really basic - I am trying to write a query to show all records from table A linked to table B so that if a field is blank in table B, it will show. At the moment, every time I run the query, it only shows me records which have entries in both tables. (They are linked by ID no).
ie there are 77 records in table A. Only 23 in table B but I want a query showing which ones in table A do not have something in field "x" on table B. Does that make any sense ? As ever, I'd be ever so grateful for help.

While I'm at it, does anyone know anything about getting a database to produce reminders ie based on date entered, highlight when 3 month review is due ?

Thank you thank you

View 5 Replies View Related

Pulling A Value From A Form To Create New Records In Append Query

Feb 27, 2006

So, I've been searching through this forum and can't seem to find the answer to this one. I would like to capture a value from a main form and have it used as a value in an append query, in order to populate a subform based on the main form, like so:

INSERT INTO tblTakenSurveys ( VisitID, SurveyQuestionID, ResponseCodeID) SELECT Forms![frmMyFormName]!VisitID, tblSurveyQuestions.SurveyQuestionID, 66
FROM SurveyQuestions WHERE SurveyID = 3;

Might help to explain some of the terms in this statement:
tblTakenSurveys is where I need the new data to be entered via the subform.
Forms![frmMyFormName]!VisitID is a textbox control bound to a PK in another table that has a one-to-many relationship with tblTakenSurveys.
tblTakenSurveys.ResponseCodeID is a foreign key that represents respondents actual answers to questions.
66 is a value for a ResponseCodeID that stands for a dummy value meaning "data not yet entered"


As per advice I received from others on this forum, I have set a query like the above to run from a command button to populate the subform (in theory). But I'm sure I've done something wrong within the query because it will not return a value from the form "VisitID" control and therefore will not append the rows. Without the appended rows, my subform will not populate. And this has me running in circles...

I pasted the link to another thread below, where I originally received a lot of input as far as the table structure. I did not start this one, but my posts are the most recent (as of now anyway). Pat Hartman had given me a lot of the guidance here.

http://www.access-programmers.co.uk/forums/showthread.php?t=100176

View 1 Replies View Related

Using Multi-Line Text Box To Pull Specific Records To A Report

Oct 23, 2014

I'm trying to have users enter multiple IDs from a table into a text box separated by newline chars, and then (once they press a button) have some sort of macro or code read each line and pull a report I've created based on the ID. Is that possible?

Example:

Table
ID
DataPoint1
DataPoint 2
DataPoint 3

1
d1
d4
d7

2
d2
d5
d8

3
d3
d6
d9

Text Box (User will enter values and hit OK)
2
3

Report

ID: 2
DataPoint 1: d2
DataPoint 2: d5
DataPoint 3: d8
-------Page Break------------
ID: 3
DataPoint 1: d3
DataPoint 2: d6
DataPoint 3: d9

View 2 Replies View Related

Getting Query Criteria To Select All Records Or Specific Records In Query Design Section?

Jun 16, 2014

How can I get a Query Criteria To Select All Records or specific records in query design section.

I have a table that shows many departments with credit card transactions. I like to run a query to see specific department, or have an option to see all the departments when the query is run.

View 2 Replies View Related

Queries :: Converting CSV File Into Text Format - Export Records With Specific Series And Date

Jun 7, 2015

I have a CSV file and want to convert it in a text format with some filtered data and with some formatting. This is an everyday task for me. So I made a table and imported the data in to it by the command :

DoCmd.TransferText acImportDelim, "fo Import Specification", "fo", FileName:="C:UserswelcomeDesktopfo.csv", HasFieldNames:=True

Actually I have a column "SERIES", contains various series like "EQ", "BE", "DR", "BZ", "D1" and so on. And one more column with the dates having 4 / 5 current months dates and one next months date and one next to next month's date. And every date has got several thousand records.

now the issue is that : After importing these several thousand records, I want to export it but with a specific date and with a specific series.

The other thing is that, these dates change every month so if hard coded, the problem will occur the next month.

I use this code for export :

DoCmd.TransferText acExportDelim, "NewFnoSpec", "fnoquery", "C:UserswelcomeDesktopFO Output.txt", True

this code is working fine but when the month will change, the code won't work.

Can we have a date & series picker attached to this query, so it can export the records with the specified SERIES & DATE.

I tried putting a textbox on the form named TxtDate and in a Query ( Design mode ) under the date column, in criteria I have put [Forms]![Futures]![TxtDate] and after putting this line, the query becomes empty and no data is there.

View 14 Replies View Related

Pulling From A Record Into A Text Box...

Jul 7, 2006

I've made the form below, with a sub form in it to show the table below the text boxes. What I'd like, is for the user to be able to select a record on the table (preferably just by clicking on it) and the text boxes to automatically populate with the relevent data. Is there a way to do this?

http://i73.photobucket.com/albums/i204/tomjamieson/frm.jpg

View 4 Replies View Related

Modules & VBA :: Search CSV To Find Specific Statement / Text On Specific Line?

Jul 8, 2015

how to read a specific line in a CSV file (using VBA), to see if the phrase "There are no records available." is present.

If it is present, then I'm going to do a debug.print stating that there are no records to load - and then the script will move on to the next file. If the phrase isn't present, then I'm going to upload the file to Access, parse the information, and then upload it to a CRM. (I already have the latter portion of the code up and running....I just need to account for the first part, where I can determine if the file has data or not).

The structure of the file never changes. The first row is composed of eight column headers (Post Date, Card Number, Card Type, Auth Date, Batch Date, Reference Number, Reason, Amount) and (if) the phrase "There are no records available." is present, it will show up on the second row, in the first column (under Post Date).

View 3 Replies View Related

Expression - Pulling A Number From A Text Box

Aug 8, 2012

I am trying to pull a number from a text box. I listed the expression for the box below. [Current Record] is a number and Count(*) is a number. I couldn't figure out what field gave me the total records so I did a count instead. If I want to pull the value from just the count portion, what expression would do that?

Code:
=[CurrentRecord] & " of " & Count(*)

Note the spaces on either side of "of"

View 6 Replies View Related

Modules & VBA :: Using Three Text Boxes As Parameters For Specific Query

Mar 20, 2015

I have a form with three text boxes and one button. I want to use these three text boxes as parameters for specific query, thus i want a code that has the ability to pass these three value to query parameters or another code to solve this problem.

View 2 Replies View Related

Select Only Records For Specific ID Query

Jul 31, 2007

This is killing me,

I have a form with a unique ID, I have a query that pulls all data regardless of the ID on the form.

How can I get the Query to pull only the data for the ID that is currently in view on the form?

Please help..

Thanks,

Fen How

View 2 Replies View Related

Forms :: Export Query To Text File With Specific Formatting?

Oct 28, 2013

I have successfully put together some VBA code that will accept a user's input into a textbox on a form. A cmdFindprinter button is clicked and the query is ran. The user is asked via an inputbox for their login ID so that the query is exported to a text file on the desktop. The query then pops up in a new tab and also automatically exports the queried record to a text file on the desktop. I have upward of 30 users using this form at any given time and I need the following automated.

What I would like to do is to have the text file go into a specific format. For example:

IP address:
Serial number:
Location:

The name of one of the queries is "Xerox IP Query", the field names would be "IP Address", "SerialNumber", and "Site Name".

This is what comes up in the text file right now:

"CXF345946","157.229.243.58","123 Happy Ave"

I'd like to remove the quotes and have the info fall into place as shown in the example above.

This is the code so far:

Code:
Private Sub cmdFindprinter_Click()
On Error GoTo cmdFindprinter_Click_Err
Dim strPath As String
userNT = InputBox("Please enter your NT ID", "ServiceBase Xerox Printer Query", "Enter your NT ID")
strPath = "C:Users" & userNT & "DesktopPrinterQuery.txt"
If Heading = 0 Then Exit Sub

[code]....

View 4 Replies View Related

Not Pulling All The Records For Last 24 Hours

Jan 25, 2008

Here is my issue I am having, With the records we are pulling it is not pulling everything from the previous 24 hours. It is using the "D" to pull the information, however it is also using the default system time, so if i have a record that occured last night at 8:30 pm it is not showing up.

How do i get all of the records from the last 24 hours regardless of system time?

View 14 Replies View Related

Forms :: Query Excluding Specific Records?

Jan 16, 2015

Trying to build a CRM system for the office but am getting stuck with the below...

Each company (tblCompany) in the database has at least 1 enquiry (tblEnquiries) linked to it and normally at least 1 (sometimes 0) people (tblPeople).

I have a form which loads company specific information e.g. notes/quotes/orders/people/enquiries. All data is loaded based on the company unique id (c_id).

The attached image shows Company 1 (c_id = 1). It has 6 enquiries. However the subform only displays 5 of these. It does not display any which do not have a person (or p_id) linked to it - this is consistent throughout the database. I have included the table relationships and the enquiry as well in case they are needed!

Searching the net seems to suggest 2 possibilities:

1 - the relationship join type needs to be set to include all from tblEnquiries and only those from tblPeople where joined fields are equal, however changing the join properties does not appear to have an effect.
2 - table field types do not match (all _ID fields are set to number, unique numbers only).

[edit]: am using Access 2010!

I have re-designed the query to pull through tblEnquiries and tblPeople data based on the c_id field on the open form, which is now showing all records, including those not assigned to a person.

However, in the form I can select one from the query datasheet and open to see additional info. Those without a blank p_id number do not open, I receive the error:

"Run-time error '2113': The value you entered isn't valid for this field.

All _id fields are set to numeric so am not sure how to correct this?

View 2 Replies View Related

Pulling Most Recent Records For Each Company

Jul 10, 2007

Hello All,
I've searched and searched and can't find anything but it might be because I'm not sure what to search for.

Here is what I'm trying to do. (I'm simplifying this to make it easier to discuss)
I have a table that looks like this:
Company Date Sales
1 5/5/07 $1,200.00
1 6/5/07 $4,200.00
1 7/5/07 $2,200.00
1 8/5/07 $4,300.00
2 5/5/07 $1,200.00
2 6/5/07 $4,200.00
2 7/5/07 $2,200.00
2 8/5/07 $9,200.00
2 9/5/07 $1,200.00

I need to run a query that grabs the last 3 months for each company.

So the correct output from the above table would be:
Company Date Sales
1 6/5/07 $4,200.00
1 7/5/07 $2,200.00
1 8/5/07 $4,300.00
2 7/5/07 $2,200.00
2 8/5/07 $9,200.00
2 9/5/07 $1,200.00

Any help would be appreciated. I'm sure this has been asked in the past so even if you could help me with a keyword to search for, I would be greatful.

Thanks in advance,
Randy

View 4 Replies View Related

Queries :: Use A Query To Select Specific Records From Table

Dec 14, 2013

While I am not new to Access, I am not well versed in its abilities as far as combo boxes go. What I have is a Form where a combo box allows you to pick from a table records 'record ID #' in order to fill in the data of that record to the rest of the form.What I want to do is use a query to select specific records from this table and allow the combo box to show only these 'selected Record IDs' for user selection.

View 1 Replies View Related

Queries :: Pulling Records Based On Date Of Another Record?

Sep 29, 2014

I have a file of transaction history from the accounting system. All of the payroll cash payments are coded as ZG. Payroll accruals are coded as ZC. I need a sum of payroll accruals by department that have the same date or later than the last payroll cash payment. How do I write that query?

View 1 Replies View Related

Access 2010 - Pulling TOP / Max Number Of Records User Prompted For Value

Oct 23, 2013

I would like a user to specify the total number of records they need from a query result. The result must be random, therefore cannot filter on any field or data in the table.

On a form, the user enters the total # of records they need and selects a button that executes this:

DoCmd.RunSQL.SELECT DcountRDP.RDP_IND, DcountRDP.GRP_ST_CD, DcountRDP.AUDIT_STATUS, DcountRDP.AUDIT_TYPE, DcountRDP.AUD_ID, DcountRDP.ACURT_IND, DcountRDP.AUD_DT
FROM DcountRDP
WHERE DcountRDP.MaxRecords = [Forms]![Open_Frm]![IL]

This is not working at all.

How can I make it possible for the user to enter a total needed or be prompted to enter a total and then randomly produce the first top # of records that they specify?

View 1 Replies View Related

Forms :: How To Hyperlink From Query To Specific Record In A Specific Form

Jul 23, 2013

I want to hyperlink from a query direct to the relevant record in a specific form. I have a hyperlink field in the form which shows up in the query. When clicked in the query, this hyperlinks to the form but I cannot make it select the correct record in the form.How do I get it to select the correct record?

View 3 Replies View Related

Modules & VBA :: Possible To Export Select Records And Fields In Those Records To A Specific Location?

Jun 15, 2013

In an Access 2010 form is it possible to export select records and fields in those records to a specific location?

Code:
Set objDialog = Application.FileDialog(4)
With objDialog
.AllowMultiSelect = False
.Title = "Please select a File"
.InitialFilename = "C:"
.Show
If .SelectedItems.Count = 0 Then
MsgBox ("Action Cancelled")
Else

[code]....

The user can select the directory using the code above, but can specific fields in records be exported to a excel workbook in that selected directory?For example, if the are 5 records in the database can the fields LastName,FirstName,BirthDate in records 1,2,3 be exported to Setup.xlsx in that selected directory?

View 1 Replies View Related

Pulling Up A Query With ASP

Mar 11, 2007

Hi, I was wondering if someone could check this code over. I am trying to pull a query (titled: Codes_+_Conduct:_General)which was already created in Access. Here's the code: (the red is where the error message I get is)

-----------------------
<%
Set objCon = Server.CreateObject("ADODB.Connection")
objCon.Open connectionstring
Set objRS = Server.CreateObject("ADODB.Recordset")
strQuery = "SELECT * from Codes_+_Conduct:_General order by subject asc"
objRS.Open strQuery, objCon
IF rs.EOF Then
Response.Write("<tr><td colspan = 3>No Tips</td></tr>")
Else
Do While not rs.EOF
x = x + 1
%>

<strong><%=rs("subject")%></strong><br>
<strong>Q</strong> <%=replace(rs("question"),vbcrlf,"<BR>")%>
<br><br>
<strong>A</strong> <%=replace(rs("answer"),vbcrlf,"<BR>")%>
<br><br>

<%
rs.MoveNext
Loop
End If
rs.Close
Set rs = Nothing
Set objCon = Nothing
%>

------------------

The error message I receive is:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.

/faqs2.asp, line 13


If anyone could offer me any help, I would greatly appreciate it. Thank you.

View 4 Replies View Related

Why Is My Query Pulling One Record Only?

Apr 13, 2007

Hello Everyone,

I've been trying to figure out why my query only pulls record Object ID 10011399 and not the other one, but I can't figure it out. Can anyone please help me see what's wrong?

Thanks,

Pablo

View 13 Replies View Related

Query Pulling From Form

Aug 10, 2007

I am having an issue pulling information from a form into a query. In my criteria column in the query i have:

[Forms]![frm_createcsv]![txtCriteria]

it pulls from a valid string from a textbox txtCriteria.

My vba code is:

Dim query as string
query = "pkg_not_registered_email"

filename = "C:querytester" & Format(Date, "YYYY_MMDD") & "_" & cboCountry.Value & "_" & ".csv"

DoCmd.TransferText acExportDelim, "", query, filename
DoCmd.Open query

____________________

This exact code worked previously with another function and a different query so I do not understand why it is not working now! Help! :(

View 7 Replies View Related

Queries :: Query Not Pulling Through All Data?

Oct 6, 2014

I am currently trying to pull a query off from a table that needs to have 3 columns side by side, linking to the same ID number. I seem to have managed to do this by making three seperate queries for each column I need, however, when I put it into one query, it is only pulling through the data form the second column (a total of 273 rows), when it should be pulling through the data from the first column (800+ rows).

The SQL looks like thiss:

SELECT [SM_Antennas_DL-1_Q].[Site ID], [SM_Antennas_DL-1_Q].[Antenna Type], [SM_Antennas_DL-1_Q].[Electrical DT], [SM_Antennas_DL-2_Q].[Electrical DT], [SM_Antennas_DL-3_Q].[Electrical DT]
FROM ([SM_Antennas_DL-1_Q] INNER JOIN [SM_Antennas_DL-2_Q] ON [SM_Antennas_DL-1_Q].[Site ID] = [SM_Antennas_DL-2_Q].[Site ID]) INNER JOIN [SM_Antennas_DL-3_Q] ON [SM_Antennas_DL-1_Q].[Site ID] = [SM_Antennas_DL-3_Q].[Site ID];

So the data DL-1, DL-2, DL-3 is from the same database.

View 8 Replies View Related

Query Pulling A Column Not Existing In The Table

Nov 6, 2007

Is there a way to specify in the query sql, if column XX exists in a table, pull it, if doesn't exist, create a blank column "XX" ?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved