Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command for a query

Status
Not open for further replies.

jeprox

Technical User
Aug 3, 2001
12
0
0
US
I just created a query with data from a table.One of the fields in the table is Invoice No.
When I open this Query, all the record appear. I need to have only a specific record based on a criteria to show up, in this case, I want to pull up a specific Invoice No.
My Invoice Nos are formatted like this: AB1234 and these are not generated automatically. I just create them.

Thank you for any help!
 
Add a WHERE clause to your query:

WHERE (((tblYourTable.YourInvoiceField) Like [Put text for input box here]))

You'll get prompted for the invoice you want to find and the query will only return row(s) which match your input.
 
Do I type this in the Critera are below the InvoiceNo Field?
If so, I must be doing something wrong because it wont Run.
This is what I typed.

WHERE(((tblOrders.InvoiceNo) Like [Put text for input box here]))

Thanks again.
 
That is part of the SQL language for your query, which you would use if you are writing your query in the SQL view. It sounds like you are designing your query in the Design view, though, so do the following:

In the Design view, enter the following into the criteria box below the InvoiceNo field:

Like [Put text for input box here]

When the query runs, you will get a dialog box with a prompt containing the text you entered between the brackets, so you can substitute your own phrase for the "Put text for input box here".

After you do this, you can, if you wish, change the query view to the SQL view, and look at the underlying SQL statement that was constructed. It will contain a WHERE clause as I noted in my first post. If you are new to Access coding, you don't have to worry about this, though, as Access writes the SQL language for you when you design a query in the Design view.

 
Great! Im kinda new to this and this forum really helps beginners like me.
Thanks Bry!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top