Question:

Crystal Reports - Sequel - Date Range Question?

by  |  earlier

0 LIKES UnLike

I’m trying to write a report and the date range of the data can’t exceed 30 days… from the first date selected. Which may not be todays date so. Employers want a pop up window to appear telling user they have exceeded, dont need to know how to limit. does this make sense

User selects Begin date of 12/01/07 and an End date of 2/2/08

The data retrieved should only be 12/01/07 – 12/31/07

Any clue how to write this in Sequel or Crystal Reports.

I can see a “30 days old” function … but that retrieves data 30 days old from current date.

Also, the user may select less then 30 days of data, so I don't want to hard code a 30 day range. Range will be Enter: "Begin date", Enter "End Date" which will be = ("Begin date" + <= 30days")

 Tags:

   Report

1 ANSWERS


  1. Create two parameters that collect single dates and name them ?BeginDate and ?EndDate.

    Create a formula called @AdjustedBeginDate that returns the ?BeginDate parameter.

    Create a formula called @AdjustedEndDate that returns the lesser of ?EndDate or ?BeginDate+30.

    In your record selection criteria, apply a filter on your database date field using the @AdjustedBeginDate and @AdjustedEndDate formulas. For example,

    ({TABLENAME.DATEFIELDNAME} between {@AdjustedBeginDate} and {@AdjustedEndDate})

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions