View Single Post
  #2  
Old August 25th, 2009, 10:08 PM posted to microsoft.public.access.gettingstarted
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Report is not pulling the correct dates

You need to convert it to a real date. You could do it something like below
in a query. Change the 3 DateField's to the correct field name.

TheDate: CDate(Left([DateField],2) &"/"& mid([DateField],3,2) &"/"&
mid([DateField],5,4))

Their is a problem with CDate in that it will cause an error if you pass
something to it that can't be evaluated as a date. For example and empty or
null field or something like 13132008 or 02302009. You could run something
like below to see if any of your data is a problem.

ADate: IsDate([DateField])

It will return FALSE for any problem records.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"marti" wrote:

I have a table that I import data from an excel sheet into daily.
Occaisionally, I have a need to run a report based on an interview date off
of this table. The report not only will show the dates I need, but also a
bunch of other dates.
I think that the format of the date in the table is causing the problem. The
date is formatted as a text and reads 12212008 (Dec 21, 2008) or 2022009(Feb
2nd, 2009).
I am a beginner level Access user and could use any suggestions anyone may
have. Please let me know if more infomationis needed and thank in advance.