473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Date calculations

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
3 1708
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
1,418 Expert 1GB
Hi,

U can try also

Field> Now() or is null

:)
Sep 16 '06 #3
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

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

Similar topics

1
by: Marc | last post by:
I've got a PHP script that's using fopen to connect to a remote web server and pick up data. I've run into a problem in calculating elapsed time. The remote web server outputs a time and I'd...
13
by: perplexed | last post by:
How do you convert a user inputted date to a unix timestamp before insterting it into your database? I have a form, with a textfield for a date that the user inputs in the format mm-dd-yyyy and...
2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
30
by: Dr John Stockton | last post by:
It has appeared that ancient sources give a method for Numeric Date Validation that involves numerous tests to determine month length; versions are often posted by incomers here. That sort of code...
11
by: lduperval | last post by:
Hi, I`m trying to do date calculations in three types of time zones: local, GMT and specified. The issue I am facing is that I need to be able to specify a date in the proper time zone, and I`m...
2
by: Joe Jax | last post by:
I have some date calculations that add a time span to a date. The problem is, when I add a time span that is a whole number of days to a date, the result can be +/- 1 hour due to daylight savings....
1
by: bluerocket | last post by:
I have searched this group, and am not finding the answer I am looking for -- hope you can help. I have a front-end MS Access database hooked via a MyODBC link to a MySQL database. A modified...
5
by: Simon Dean | last post by:
Probably being a little thick here, but when you subtract one date away from another, how do you convert the resultant value into a number of days... I guess I could easily / 60 / 60 / 24... but...
3
by: Glencannon4424 via AccessMonster.com | last post by:
Hello, I have what I believe amounts to a Date Serial issue. I have the following columns in my table: Hire-Date Hire-Year WTD-RATE Wks-in-Yr
8
by: Charlie Brookhart | last post by:
I am creating a program that involves having to find the difference between two dates and converting it to a number to be used for calculations. The problem is that the way it is setup, VB is not...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.