Date Timestamp

M

Matt

I'm having problems trying to pull a set of data based off the date. This
date field has a date and timestamp. (Example: 5/18/2009 6:03:49 PM)

What i'm trying to do is pull all records <=#5/18/2009#. Since it has a
timestamp, I don't get all the records with 5/18/2009 in the date field.

Is there a way I can convert the dates to not include the timestamp and
still pull everything that is <=#5/18/2009#?

I'm hoping to do this without bringing the data into a local table and
changing the field format to short date. Reason being that the table I'm
pulling from is quite large.

Thanks in advance for your help.
 
M

MGFoster

Matt said:
I'm having problems trying to pull a set of data based off the date. This
date field has a date and timestamp. (Example: 5/18/2009 6:03:49 PM)

What i'm trying to do is pull all records <=#5/18/2009#. Since it has a
timestamp, I don't get all the records with 5/18/2009 in the date field.

Is there a way I can convert the dates to not include the timestamp and
still pull everything that is <=#5/18/2009#?

I'm hoping to do this without bringing the data into a local table and
changing the field format to short date. Reason being that the table I'm
pulling from is quite large.

Thanks in advance for your help.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

For the criteria, use the day after the date you want:

< #5/19/2009#

For the display of just the date, use the DateValue() function:

Expr1: DateValue(date_column)

Conversely, you can use TimeValue(date_column) when you want just the
time.

HTH,
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA+AwUBShNR0IechKqOuFEgEQKv5ACYlLJywwq7AaYRqtH1x51zMSUw6gCfR6DW
STVsh7XbWYxmJSJHWfi+B4M=
=hYN6
-----END PGP SIGNATURE-----
 
J

John W. Vinson

I'm having problems trying to pull a set of data based off the date. This
date field has a date and timestamp. (Example: 5/18/2009 6:03:49 PM)

What i'm trying to do is pull all records <=#5/18/2009#. Since it has a
timestamp, I don't get all the records with 5/18/2009 in the date field.

Is there a way I can convert the dates to not include the timestamp and
still pull everything that is <=#5/18/2009#?

I'm hoping to do this without bringing the data into a local table and
changing the field format to short date. Reason being that the table I'm
pulling from is quite large.

Thanks in advance for your help.

Try a parameter query and include the entire day in the parameter:

< DateAdd("d", 1, [Enter date:])

If you enter 5/18 at the prompt, this expression will find all records before
midnight 5/19 - i.e. up through 11:59:59.99999999999 on the 18th.
 

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