Access question

snidy1

Golden Member
Mar 17, 2003
1,285
0
0
I'm trying to figure out how I can retrieve only records from todays date - 6 months. I just want to list employees that have been here under 6 months.
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
Set the query to calculate a date range

DATE less than today and DATE+180 greater than today


DATE is the datafield

You may have to research how to do the calculation.
 

Zontor

Senior member
Sep 19, 2000
530
0
0
Been years since I used access (use MSSQL now) but from memory:

SELECT * FROM foo WHERE the_date <= DateAdd("m", -6, now());

You may want to modify this a bit to either include or exclude your endpoints.

I think you only need to wrap literal dates in the # symbols....

Edit: Decided to look up something....maybe want to use date() instead of now() although it should work.

This should help you too.