date query

wardy

Registered User.
Local time
Today, 16:15
Joined
Sep 4, 2007
Messages
21
hello all,
i would very much appreciate anyone's help with this,, i have a table that contains various data,,i would like to write a query that will give me all records that have been allocated an 'issued date' in the last two weeks,, the 'issued date' is a box on my form that has a calendar attached, what do i need to write in the criteria of the query?
many thanks
 
i would like to write a query that will give me all records that have been allocated an 'issued date' in the last two weeks
Wardy, this should work (to get records from the table only)....
Code:
WHERE [issued date] >= DateAdd("ww", -2, Date());
I assume the box on the form has nothing to do with the query because this is where you input your data when it comes in...if this is the case, that's just a data entry tool.

If you're looking to get records based on what you enter in the box, you'll have to change a bit...
Code:
WHERE [issued date] "COMPARISON OPERATOR" forms![formname]![box]
 
Simplistically (is that a word?) in the query criteria of the date field, - Between [Enter From Date] And [Enter To Date] - will provide prompts where you can enter from and to dates which will limit the result to that date period. If your form is based on that query, you will see only the records between the criteria.

Chris B
 
Simplistically (is that a word?) in the query criteria of the date field, - Between [Enter From Date] And [Enter To Date] - will provide prompts where you can enter from and to dates which will limit the result to that date period. If your form is based on that query, you will see only the records between the criteria.

Chris B


Or more simplistically, Between Date() and Date()-14. This way, the query will run automatically without having to enter from and to dates
 
Great simplicity.

I am inclined to say though, that when a situation like this comes up, I LOVE using the program as a means of calculating dates. Access has got date ranges stored until the end of time!! Why not use them?? I'm all about letting the program do the work....after all, calling stored functions is usually a pretty safe bet.
 

Users who are viewing this thread

Back
Top Bottom