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

Entering date and displaying last 12 months 3

Status
Not open for further replies.

mitmat

IS-IT--Management
Mar 26, 2002
24
GB
Hello Guys

I'm trying to run a report that asks for a call open date and then only displays the last 12 months from the date entered.
Currently the Parameter asks for start and end date but this appentley isn't good enough.
Any help will be most appreciated..

Matt
 
If you literally mean the last 12 months, then you could use a record selection statement like:

{table.date} in dateadd("m",-12,currentdate) to currentdate-1

Or, if you mean the last 12 full months, then try:

{table.date} in dateadd("m",-12,currentdate-day(currentdate)+1) to currentdate-day(currentdate)

-LB
 
Thanks Ibass,

This gives me the previous 12 months from Currenttdate.
Is there a way of setting it to list only the previous 12 months from the Parameter date that's entered by the user

Matt
 
Try this:

{table.date} in dateadd("m",-12,currentdate) to {?ParameterDate}

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"making predictions is tough, especially about the future" - Yogi Berra
 
That's excellent! Thanks dgillz
 
I think that should be:

{table.date} in dateadd("m",-12,{?ParameterDate}) to {?ParameterDate}

-LB
 
Well spotted Ibass, I thought it was working but I was putting in Todays date derrr.

You're the man..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top