print date of query parameter on report header

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query with a parameter under the Date field as follows :
Between [date] And [date]

then I've created a report from this query. When I run this report,
the parameter box pops up for the user to fill in the date period
as according to the Query-parameter.
The report prints out fine with all the data IAW the period of both "dates"
entered.
I just can't figure out how to get "Between [date] And [date]" printed
on the report header, it should print (e.g.) Between 10/01/2005 And
10/31/2005.

Please help.
thanks,
Karen
 
Hi Karen
There might be a better way to get the parameters, one way it's to include
the parameters in the query itself

Select Field1,Field2,[Start Date] As ParamStartDate, [End Date] As
ParamEndDate from TableName Where DateField Between [Start Date] And [End
Date]

In the report header you can create two text fields and in the source od
each field you can write: ParamEndDate , ParamStartDate

HTH, Good Luck
 
First, if the field in your table/query is actually named "Date", you should
change its name to something that is not the reserved word "Date" (eg.
DateOfBirth).

Next, rename the prompt strings in your query so that they are different,
and also not the reserved word "Date". In other words, set your parameter
to something like "Between [Enter Start Date] And [Enter End Date]".

Finally, in your report header, insert a textbox and set its ControlSource
to:
="Between " & [Enter Start Date] & " and " & [Enter End Date]

HTH,

Rob
 
Brilliant! It works out perfect!
Thanks very much for all your help.
Karen

Rob Parker said:
First, if the field in your table/query is actually named "Date", you should
change its name to something that is not the reserved word "Date" (eg.
DateOfBirth).

Next, rename the prompt strings in your query so that they are different,
and also not the reserved word "Date". In other words, set your parameter
to something like "Between [Enter Start Date] And [Enter End Date]".

Finally, in your report header, insert a textbox and set its ControlSource
to:
="Between " & [Enter Start Date] & " and " & [Enter End Date]

HTH,

Rob


KarenY said:
I have a query with a parameter under the Date field as follows :
Between [date] And [date]

then I've created a report from this query. When I run this report,
the parameter box pops up for the user to fill in the date period
as according to the Query-parameter.
The report prints out fine with all the data IAW the period of both "dates"
entered.
I just can't figure out how to get "Between [date] And [date]" printed
on the report header, it should print (e.g.) Between 10/01/2005 And
10/31/2005.

Please help.
thanks,
Karen
 
Back
Top