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

Date Based Report - Crystal Reports XI 1

Status
Not open for further replies.

moopenguin32

Technical User
Dec 23, 2008
20
0
0
US
My goal is to run a report that will show information for a certain date depending on the date the report runs.

There are two date fields I need the query to run against: ScheduledStartDate and ActualStartDate

If the report runs on a Wednesday, I need it to pull records with either a ScheduledStartDate or an ActualStartDate of Sunday. So, if I run the report on 1/28, it will pull records with either a ScheduledStartDate or an ActualStartDate of 1/25. The report will always run on Wednesday and will always pull data from Sunday.

The reason I want it to run like this is because I need to schedule it on a Crystal Enterprise Server to run for the next 6 weeks.

I was thinking I could have a parameter field called MasterSpecificDate and it would default to 1/1/1900 which would equal today's date using a formula called SpecificDate (I have done this in other reports). Then in the record selection query, I could have something like:

{ScheduledStartDate} > DateAdd("d", -3,{@SpecificDate}) and
{ActualStartDate} > DateAdd("d", -3,{@SpecificDate})

Obviously this does not work, but I'd like to think I'm on the right track. Of course, I am open to any way that will achieve what I need.

Thank you in advance for your assistance.

"Remember, today is the tomorrow you worried about yesterday." - Dale Carnegie
 
You could use
(
{ScheduledStartDate} = Minimum(WeekToDateFromSun) or
{ActualStartDate} = Minimum(WeekToDateFromSun)
)
 
Or you could use

(
{ScheduledStartDate} = currentdate - (dayofweek(currentdate-1)) or
{ActualStartDate} = currentdate - (dayofweek(currentdate-1))
)
 
I will try these out and see how they work. Thanks for the help.

"Remember, today is the tomorrow you worried about yesterday." - Dale Carnegie
 
I just tried both formulas today and they worked great. Thank you so much!

"Remember, today is the tomorrow you worried about yesterday." - Dale Carnegie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top