Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display correct Month/Year at top of report 2

Status
Not open for further replies.

firefly77

Technical User
Dec 16, 2004
1
US
I am running CR professional 9.2.

I have a report that uses the LastFullMonth function in the Select Expert to extract all data from a previous month. This works just fine. What I need help with is displaying the correct month and year of the report at the top of the page relative to the data, not relative to when the report is opened.

Currently, I run the report around the first of the month so currently I use a function that looks back 10 days to get the correct month. For the year, I do the same (looking back 10 days) so that when I run the report in January I get the previous year.

The problem comes when I open the report after 10 days have passed. I get the current month instead of the previous one. We save reports and sometimes reopen or reprint passed the 10 days.

Someone must have addressed this before, but I cannot find anything.

Thanks,
Firefly77
 
Hi.

Here is one way to go:

ToText(Year(Minimum(LastFullMonth)),0,'')

ToText(Month(Minimum(LastFullMonth)),0)

/Goran
 
try using a (group) total on dates in the data. for example a maximum of the date would give you the most recent date in the last full month selection. Then change the format to a month/year.


Lochbel
 
If you want it in one field:
ToText((Minimum(LastFullMonth)),'yyyy-MM')

/Goran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top