How to add a day on a select statment

S

Sam

The following select statment doesn't work for my Access database. It
doesn't return any data.

SELECT ID FROM adj
WHERE EndDate-1<[Date]

It works if the database is from my company server via a link. It also works
in my local Access database if I delete the '-1'.
I use Date/Time as the data type for the EndDate column.

I tried DateAdd Function.

Please help!
 
K

kc-mass

Hi Sam

Try:
SELECT tbladj.ID
FROM tbladj
WHERE ((([EndDate]-1)<Date()));

Regards

Kevin
 
M

Marshall Barton

Sam said:
The following select statment doesn't work for my Access database. It
doesn't return any data.

SELECT ID FROM adj
WHERE EndDate-1<[Date]

It works if the database is from my company server via a link. It also works
in my local Access database if I delete the '-1'.
I use Date/Time as the data type for the EndDate column.

I tried DateAdd Function.


DateAdd is the preferred approach. Are you sure you are
entering a good date in the prompt popup? If your Windows
settings have a different date format than you are using,,,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top