Query - using > than

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to know if it is possible to write a query where the greater than changes each time. In other words, I have a query that prompts me for an issue date, which I can give - 1/1/04 - or something similar and the records come up. But if I change the query and ask for a prompt for something like - >1/1/04 , it says it's too complicated

When I input the same criteria in the actual design of the query, it works. Is there a way to enter this as a prompt to where I don't have to go into the design of the query each time I want to change that date

Any help would be greatly appreciated!!!!
 
change the query so the criteria is
[Please enter date]



Teri said:
I would like to know if it is possible to write a query where the greater
than changes each time. In other words, I have a query that prompts me for
an issue date, which I can give - 1/1/04 - or something similar and the
records come up. But if I change the query and ask for a prompt for
something like - >1/1/04 , it says it's too complicated.
When I input the same criteria in the actual design of the query, it
works. Is there a way to enter this as a prompt to where I don't have to go
into the design of the query each time I want to change that date?
 
Where [Date] > #1/12/2004#;

Dates can usually be put between pound signs.

Where [Date] > #January 12, 2004#;


Teri said:
I would like to know if it is possible to write a query where the greater
than changes each time. In other words, I have a query that prompts me for
an issue date, which I can give - 1/1/04 - or something similar and the
records come up. But if I change the query and ask for a prompt for
something like - >1/1/04 , it says it's too complicated.
When I input the same criteria in the actual design of the query, it
works. Is there a way to enter this as a prompt to where I don't have to go
into the design of the query each time I want to change that date?
 
I would like to know if it is possible to write a query where the greater than changes each time. In other words, I have a query that prompts me for an issue date, which I can give - 1/1/04 - or something similar and the records come up. But if I change the query and ask for a prompt for something like - >1/1/04 , it says it's too complicated.

When I input the same criteria in the actual design of the query, it works. Is there a way to enter this as a prompt to where I don't have to go into the design of the query each time I want to change that date?

Any help would be greatly appreciated!!!!

Certainly. It's called a "Parameter Query" and it's a very useful
technique!

Rather than entering the date in the criteria line, put a prompt in
square brackets:
[Enter date:]

Just to protect users who might enter odd date formats, I'll usually
wrap the prompt in:
Format(CDate([Enter date:]), "mm/dd/yyyy")

so Access sees a date format it can handle correctly.
 
Back
Top