[AccessD] Date Issue

Terri Jarus jarus at amerinet-gpo.com
Wed Jan 5 09:07:26 CST 2005


So much for easy - in my Query Grid for Start Date, I place the
criteria:  >#12/1/04#  and I get what I need.  However, if I want the
user to put in the date, such as [Enter Date], I get all the data again.
 I try entering the date at the prompt as #12/1/2004# and it still
doesn't work.
 
Any ideas - why is this just not recognizing that the data is a
date???
 
Thanks.
 
Terri Jarus
Vice President, Contract Services
jarus at amerinet-gpo.com
314-542-1902

>>> jarus at amerinet-gpo.com 1/5/2005 7:37:45 AM >>>

That did it - I knew it was easy, I just couldn't remember what the
function was.  Thanks for your help

Terri Jarus
Vice President, Contract Services
jarus at amerinet-gpo.com
314-542-1902.
>>> Gustav at cactus.dk 1/5/2005 6:53:48 AM >>>

Hi Terri

If you put that string inside CDate() you should be off:

datDate = CDate("01-05-2005")

The bulletproof method, however, is to break it into its separate
numeric parts and use DateSerial():

datDate = DateSerial(2005, 1, 5)

/gustav

>>> jarus at amerinet-gpo.com 05-01-2005 13:28:27 >>>
I am linked to a table of data from our AS400/DB2 system and a date
field appears as 20050105.  I need Access to read this as a date -
what
is the best way to handle/convert this field.  I've tried breaking it
apart and putting it back together in a query as 01-05-2005 but Access
does not recognize as a date field.  I want to query out data based on
a
date - please advise.

Thanks for your help.

Terri Jarus
Vice President, Contract Services
jarus at amerinet-gpo.com 
314-542-1902

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


---------------------------------------------------------------------------
This email and any files transmitted with it are confidential and
intended solely for the use of the individuals or entities to whom
they
are addressed. If you have received this email in error please return 
it to the sender, and erase any copies thereof.
Copyright 2004 Amerinet 1nc.
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list