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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|