Date Expression

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

Guest

I have a report with a bound control called [TransDate] (in dd/mm/yyyy
format). There is another unbound text box called [DateRange]. I would like
to display the text "1-30 January YEAR" in [DateRange] for every record where
the [TransDate] is in January regardless of the year, "1-29 February YEAR"
for every record in February, etc...

I would like to place it on the Format Event of the Footer of the report.
All suggestions gratefully received!
 
Super said:
I have a report with a bound control called [TransDate] (in dd/mm/yyyy
format). There is another unbound text box called [DateRange]. I would like
to display the text "1-30 January YEAR" in [DateRange] for every record where
the [TransDate] is in January regardless of the year, "1-29 February YEAR"
for every record in February, etc...

I would like to place it on the Format Event of the Footer of the report.
All suggestions gratefully received!


I think you can fo all that with an expression in the
DateRange text box:

=Choose(Month(TransDate), "1-30 January YEAR","1-29 February
YEAR", . . .)
 
The expression would probably be as follows.

Me.DateRange = "1-" & Format(
DateSerial(Year([TransDate]),Month([TransDate])+1,0), "dd mmmm yyyy")

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Back
Top