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

Retrieve current month records formula 1

Status
Not open for further replies.

RCCRookie

Technical User
Jul 3, 2007
29
US
I have an unlinked subreport and I would like to retrieve records for the current month only. I am grouping on the following formula:
If {Table.StringField} = "R" then "Past Due"
else "On Target"
I tried {Table.DueDateField} is in period MonthToDate in my record selection formula but that doesn't retrieve the entire month. I want the records for the entire current month no matter what day of the month user runs the report. I've been looking through this and another forum in addition to the Crystal Help file and I've finally decided to throw in the white flag. Can anyone help me?
(I'm using Crystal XI; DB SQL 2005)
 
month({Table.DueDateField}) = month(currentdate) and
year({Table.DueDateField}) = year(currentdate)

You could also use SQL expressions for the month and year of the field, and then the report will be faster, e.g.:

{fn month(table.`duedatefield`)}

Then use the SQL expressions in the selection formula:

{%month} = month(currentdate) //etc.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top