View Single Post
  #3  
Old August 26th, 2009, 08:31 PM posted to microsoft.public.access.gettingstarted
marti
external usenet poster
 
Posts: 40
Default Report is not pulling the correct dates

Jerry, I am a very new user to Access, so I am about to ask what I think is a
basic question:
In order to convert the Interview Date to a real date, I need to creat a new
query like the one below, but I am not really sure how to set that up and
then link that to the report. Do I just create a query and then link it to
the other query? I'm confused.
Thanks in advance for your patience!

"Jerry Whittle" wrote:

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.