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

Select formula for "last month" (Crystal 9)

Status
Not open for further replies.

glarkin

IS-IT--Management
Feb 26, 2002
175
US
We have a report that pulls data every morning at 3:00am for the previous day. The select statement for the timestamp is as follows:

{iAgentPerformanceStat.Timestamp} >=

cdatetime(year(currentdate-1),month(currentdate-1),day(currentdate-1),0,0,0) and
{iAgentPerformanceStat.Timestamp} <= cdatetime(year(currentdate-1),month(currentdate-1),day(currentdate-1),23,59,59)

I didn't write this report but I'm trying to re-engineer it so that it will pull data for the previous month. I don't need a range of dates, just the date of the first day in the last complete month: 11/01/2005 00:00:00. Any help or guidance will be greatly appreciated. Thanks,

Greg
 
Hi Greg,

I would use:

{iAgentPerformanceStat.Timestamp} in LastFullMonth

That should do it for you.

But if you really want to figure out the exact first and last date, you should use the DateDiff function in Crystal. Let me know if you want me to write that out for you.

-chris.
 
Please disregard. I found using "is in the Period" = "LastFullMonth" in the Select Expert did what I needed. Thanks

Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top