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

Check for one range within another range

Status
Not open for further replies.

jenschmidt

Programmer
Sep 30, 2002
145
US
I'm not quite sure how to accomplish this, but maybe someone out there has an idea.

I have a report which calculates the Start Date and End Date that should be pulled into the report based on the CurrentDate. If the end user picks a Start and End Date range that includes 2004,03,11 to 2003,04,15, then I want it to display some text.

Here's the formula I thought might work:
if Date(2004,03,11) to Date(2004,04,15) in {@Start Date} to {@End Date} then "Beware of Blank Data"

Here's the error I get:
A number, currency amount, date, time, date-time, or string is required here. (It highlights my specific date range as the "here" point.)

Any ideas on a solution?
Thanks!


jennifer.giemza@uwmf.wisc.edu
 
Try this:

if Date(2004,3,11) >={@Start Date} and Date(2004,4,15) <= {@End Date} then "Beware of Blank Data"


Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
How about

if {@start date} in [Date(2004,03,11) to Date(2004,04,15)] or {@End Date} in [Date(2004,03,11) to Date(2004,04,15)] then "Beware of Blank Data"

This will allow for any overlapping of dates at either end
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top