Skip to Content
0
Former Member
Mar 09, 2012 at 08:09 PM

Crystal Reports 2008 - help with formula to retrieve lastfullmonth

131 Views

Hi, I'm new to this forum. First post. I have a SQL query where

:month(CAST(a.LAST_MOD_DT / 86400 AS datetime) + CAST('01/ 01/1970' AS datetime)) = (MONTH(getdate())- 1)

I need to create a CR formula that will pull in data from last month as this report will be run on a monthly basis. If I use 'getdate() -31' there will be a problem with the months that don't have 31 days.

I'm also very new with creating formulas so including an explaination would be helpful. Thanks,

Joyce