browse: forums | FAQ
Connecting Tech Pros Worldwide

Hey there! Do you need Microsoft Access / VBA help?

Get answers from our community of Microsoft Access / VBA experts on BYTES! It's free.

Filtering Access Reports Based on Formated a Date

Member
 
Join Date: Sep 2008
Posts: 48
#1: Nov 6 '09
Hello

I have an access report and im using a query to filter the report using Date parameters eg Start Date-12 May 2009 and End Date-30 September 2009. the query works perfectly.

My problem is recently i formated the date values so they appear as May 2009 instead of 12 May 2009. When i tried to use the filtering query again it did not work.

Instead the result set from the query only showed records from the two dates in the parameter, May 2009 and September 2009, instead of results for the whole range May 2009 June 2009 July 2009 August 2009 September 2009.

Below is my query

>=[Start Date] And <=[End Date]

To format the date field i used this code in the query
Month: Format$([tblUsers.Date],"mmmm yyyy",0,0)

Thankyou for your help
best answer - posted by msquared
what data type are [Start Date] and [End Date] ?

Based on the results you are getting I suspect they are text fields. They have to be date fields for your query to work. You can still view them as mmm yyyy by formating the date fields.



msquared's Avatar
Administrator
 
Join Date: Aug 2006
Location: Dublin, Ireland
Posts: 11,115
#2: Nov 8 '09

re: Filtering Access Reports Based on Formated a Date


what data type are [Start Date] and [End Date] ?

Based on the results you are getting I suspect they are text fields. They have to be date fields for your query to work. You can still view them as mmm yyyy by formating the date fields.
Member
 
Join Date: Sep 2008
Posts: 48
#3: Nov 9 '09

re: Filtering Access Reports Based on Formated a Date


Hello msquared
Thankyou yes the data type was text and after changing it to date, the query worked. Thankyou again for your assitance
msquared's Avatar
Administrator
 
Join Date: Aug 2006
Location: Dublin, Ireland
Posts: 11,115
#4: Nov 9 '09

re: Filtering Access Reports Based on Formated a Date


Quote:

Originally Posted by zandiT View Post

Hello msquared
Thankyou yes the data type was text and after changing it to date, the query worked. Thankyou again for your assitance

You're very welcome :)
Reply