Link to home
Start Free TrialLog in
Avatar of Culwatrnca11
Culwatrnca11Flag for United States of America

asked on

Code to run for Last full month, not current month in Crystal and also what would be code for Teradata.

Want to schedule a report in crystal and would like to run for previous full month. How do you modify this line so that it always runs for previous full month. Report will be ran on 8th day of each month for the previous Full month.

 CAST (pat_enc.contact_date AS DATE) BETWEEN '2017-08-01' AND '2017-08-31'
SOLUTION
Avatar of Darrell Porter
Darrell Porter
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Culwatrnca11

ASKER

not sure how to add either of these suggestions to my crystal.    Here is what my selection formula looks like. How would i encorporate the Cast or Date suggestions?

{Command.APPT_STATUS_C} = 2 and
{Command.BENEFIT_GROUP} startswith ["PROVPREV", "SURGCOLO"] and
{Command.CPT_CODE} startswith ["44388", "44389", "44392", "44393", "44394", "44401", "45300", "45305", "45308", "45309", "45315", "45320", "45330", "45331", "45333", "45338", "45346", "45378", "45380", "45383", "45384", "45385", "45388", "74261", "74262", "74263", "G0104", "G0105", "G0106", "G0120", "G0121", "G6019", "G6024"]
Avatar of Mike McCracken
Mike McCracken

Try it this way

{Command.APPT_STATUS_C} = 2 and
{Command.BENEFIT_GROUP} startswith ["PROVPREV", "SURGCOLO"] and
 {Command.CPT_CODE} startswith ["44388", "44389", "44392", "44393", "44394", "44401", "45300", "45305", "45308", "45309", "45315", "45320", "45330", "45331", "45333", "45338", "45346", "45378", "45380", "45383", "45384", "45385", "45388", "74261", "74262", "74263", "G0104", "G0105", "G0106", "G0120", "G0121", "G6019", "G6024"]
AND  Date({pat_enc.contact_date}) in LastFullMonth

mlmcc
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Came up with my own solution but I am still awarding points based on both experts assisting in trying to solve my issue because I really appreciate the effort.    Thank you for your time..