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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Criteria With in a Query

Status
Not open for further replies.

melisc

Programmer
Feb 6, 2004
15
US
I am trying to set my query up so that it prompts for a location name and a date range when ran.

The date range works great but when used in conjunction with:

Like [Enter Location Name] it fails. It prompts for a location name but returns the query with no data and the date range is blanked out.

I used:

Between [Enter start date] and [Enter end date] for the date range.

Any ideas?

Thanks a bunch!
 
Can you post your complete SQL statement? Makes it easier to spot the problem. Thanks! --BoulderRidge
 
All I did was enter the command in the Criteria Line in the design view of the Query:

Like [Enter Location Name]

That does make the Query Prompt me but it returns no results. If I remove that command and just use the date range then it works perfect and returns the data for all Locations in that date range.

I would like to be able to have it require you enter a Location and a date range and return just the results for that specific location for the requested date range.
 
Hi melisc,

If I understand what you are saying, the prompting works correctly, it's the fact that the Query returns no results when you think it should return some that is the problem.

My guess is that what you actually want is in your criteria is ..

[blue][tt]Like [Enter Location Name] [red]& "*"[/red][/tt][/blue]

but if not, could you post some sample data and criteria which fail.


Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Tony,

Thanks so much for your help. That worked great!

Hope you had a great Holiday!

Thanks again!
Melissa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top