By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,489 Members | 1,954 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,489 IT Pros & Developers. It's quick & easy.

Date calculations

P: 4
Hi there,

I am trying to write a sql statement that will retrieve all records that have a date greater than today or is blank, can you help with this please. So far I have date field > date().

Thanks
Sep 15 '06 #1
Share this Question
Share on Google+
3 Replies


P: 16
First you need to make sure that your date field matches up with the function.
Date() returns mm/dd/yyyy

Then you want to try dteField >date() or isnull(dteField)
That will produce all records that are greater than today and that are blank.

If your date dosn't match up to the format you need to be creative with some code to manipulate the date to match up like:

SometxtField=right$(date$,4)+left$(date$,2)+mid$(d ate$,4,2)
That will produce a date of yyyymmdd without the slashes.

--Beat
Sep 15 '06 #2

PEB
Expert 100+
P: 1,418
PEB
Hi,

U can try also

Field> Now() or is null

:)
Sep 16 '06 #3

P: 4
Thanks very much , that has worked.

First you need to make sure that your date field matches up with the function.
Date() returns mm/dd/yyyy

Then you want to try dteField >date() or isnull(dteField)
That will produce all records that are greater than today and that are blank.

If your date dosn't match up to the format you need to be creative with some code to manipulate the date to match up like:

SometxtField=right$(date$,4)+left$(date$,2)+mid$(d ate$,4,2)
That will produce a date of yyyymmdd without the slashes.

--Beat
Sep 18 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.