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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date parameter for last day of the month

Status
Not open for further replies.

cmyoung

IS-IT--Management
May 28, 2010
15
CA
Hey all,

I am using crystal reports 8 and was wondering if there is some way I can create a date parameter that only asks for the month and year and automatically selects the last day of the selected month.

I was thinking about just entering values, but would I have to go 1-12 and something like 2000-20XX? Seems like a obsolete method to achieve the values.

If there is not an easy I know how to make a formula to auto correct a date that isn't the last date, but I just wanna make the parameter a little cleaner for what the user should be selecting, so they realize it should be the last day of the month.

Thanks!
 




Hi,

The Last day of Year, Month...
Code:
LastDate = DateSerial(Year,Month+1,0)


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I know the formula to achieve the last day of the month but I was just wondering if there is a parameter option so that the user only selects the month/date from a date serial.

If not I have other ways to solve this, so if you are replying this you don't really need to write out all the code unless you want to. I am just wondering.

Thanks though skip.
 
You could just ask them to enter any date in the month they want to and then convert their entry to the last day of the month.

I have also set up alerts so that if someone uses an end date other than the last day of the month, they are told to rerun the report and to use the corrected date (which I supply in the alert).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top