We help IT Professionals succeed at work.

Crystal Reports LastFullMonth for last year

I have a crystal report looking at service dates.  I need to look at LastFullMonth but for last year.   So running the report on 6/15/10 will only show or indicate service dates for 5/1/2009 - 5/31/2009

Date field in the table is named {psyap.appointdte}

Idealy, it would look at the record's service date and if it falls within the date range (lastfullmonth of last year), it will return a 1, if not a 0.  I can use these to count the dates in the range.
Comment
Watch Question

I think this should do it.

if {psyap.appointdte} in
 DateAdd ("yyyy", -1, Minimum (LastFullMonth)) to
 DateAdd ("yyyy", -1, Maximum (LastFullMonth)) then
  1


 LastFullMonth returns a range, so I used Minimum and Maximum to extract the beginning and ending values in the range and subtracted 1 year from each of them.

 If you want the report to actually only include the records with those dates (instead of counting them), just use that test in your record selection formula.

{psyap.appointdte} in
 DateAdd ("yyyy", -1, Minimum (LastFullMonth)) to
 DateAdd ("yyyy", -1, Maximum (LastFullMonth))


 James