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!

Query all records created before a specific date

Status
Not open for further replies.

CrimsonLily

Technical User
Feb 3, 2003
19
0
0
US
Please help! I need to know how to create a query that will tell me, when I give it a specific date, all the records that were created before that date. i.e. All the files dated before March 31, 2002.

Any advice that you can give me would be greatly appreciated!

Thanks again!

CrimsonLily
 
You will need to change [mytable] and [mydatefield] to the actual names of your table and date field:


select * from [mytable] where [mydatefield] < [Please enter date]


The query will prompt you for a date and return all records less than that date.

Mike Pastore

Hats off to (Roy) Harper
 
Thanks for the help, one more quick question:

Where do I enter this code? Is it entered on the SQL view or somewhere else?


Thanks again

CrimsonLily
 
That worked PERFECTLY!

THANKS!! I really appreicate it!
 
Hi Mike!

I am trying to do similar query but using today's date.
I always want to use today's date and get all the records dated , says 30 days from todays date.
How do I do that? Can you help?
Thanks.

I guess you use Date() to get today's date.
How do I add 20 days or month to today's date?
Do I need to parse it into numeric numbers and do calculation?
Or is there an object that i can use and 30 days or month to it?

THanks again.

QB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top