Need query to find records between dates

  • Thread starter Thread starter Techhead
  • Start date Start date
T

Techhead

I have a table called RECORDS with 2 columns in date/time format
called STARTDATE and ENDDATE. I need to query all records where the
ENDDATE is 5 days or greater in difference after the STARTDATE. It's
been a while since I've used access and can'tg seem to figure this one
out.


Thanks,
Brian
 
I have a table called RECORDS with 2 columns in date/time format
called STARTDATE and ENDDATE. I need to query all records where the
ENDDATE is 5 days or greater in difference after the STARTDATE. It's
been a while since I've used access and can'tg seem to figure this one
out.

Thanks,
Brian

I figured it out.

SELECT RECORDS.STARTDATE, RECORDS.ENDDATE
FROM RECORDS
WHERE ((([ENDDATE]-[STARTDATE])>"05"));

Easy enough... Lost a few brain cells over the years.
 
On Mon, 1 Dec 2008 19:40:29 -0800 (PST), Techhead

Check out the DateDiff function in the help file. Then create a query
like this:
select * from Records
where DateDiff("d",StartDate,EndDate) > 5

-Tom.
Microsoft Access MVP
 
Back
Top