A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Report is not pulling the correct dates



 
 
Thread Tools Display Modes
  #1  
Old August 25th, 2009, 09:38 PM posted to microsoft.public.access.gettingstarted
marti
external usenet poster
 
Posts: 40
Default Report is not pulling the correct dates

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.
  #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.

  #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.

  #4  
Old August 26th, 2009, 09: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 should be able to modify the existing query to produce a real date using
the IsDate function. You may have to change the name of the Control Source
for the text box in the report slightly to match what is in the query.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"marti" wrote:

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.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.