Date function to display month/year of query criteria

jzacharias

Registered User.
Local time
Today, 16:35
Joined
Sep 13, 2010
Messages
137
I have a textbox on the top of my report that displays the current Month/Year=Format(Date(),"mmmm"", ""yyyy") but I would like it to display the Month/Year of the query/criteria results.
 
You can create a TextBox control and bound it to your Desired Query Field. OR just drag and drop the underlined Query/Table's Field to your Report. After that change the format of the required field to MMMM/YYYY.
 
Thank you very much...Works perfect
 
Additional question. It works fine if I enter the start and end date in the criteria input for one month, but if I put in a range spanning a couple or few months, it only lists the first month. How can I display something like "November, 2012 - January, 2013?
 
How do you obtain the Start date and End date from the user?
 
In the criteria I put Between [Start Date] and [End Date]. It prompts me for the two dates.
 
Try this as the Control Source of the Unbound Textbox that holds the date format value currently...
Code:
= Format([Start Date],"MMMM, YYYY") & " - " & Format([End Date],"MMMM, YYYY")
 
Additional question. It works fine if I enter the start and end date in the criteria input for one month, but if I put in a range spanning a couple or few months, it only lists the first month. How can I display something like "November, 2012 - January, 2013?

It will display only the current record on Report, because each row will show its data on the Report.
you need some effort to correct your Query for desire result, then call the calculated field on the report.
suppose if you want to show more than a one field on a Report then:
you can concatenate both the fields on the report,

suppose an unbound control on Report named txtDate can be concatenated for the two fields named txtDate1 and txtDate2 as follows

txtDate = txtDate1 & "-" & txtDate2

example:
"November, 2012 - January, 2013"
 
ahhhhhh great you have sorted out.
Paul Eugin gave you the answer ;p
 
Sorry to have stolen the thread Khalid.. I thought you were offline before I started typing the answer in.. :(
 
Sorry to have stolen the thread Khalid.. I thought you were offline before I started typing the answer in.. :(

no problem Paul Eugin. its more important that someone got help. i am glad you gave answer.
 

Users who are viewing this thread

Back
Top Bottom