Link to home
Start Free TrialLog in
Avatar of sashmorhall
sashmorhall

asked on

Date Difference

I have an order date. I need to get all admission dates 90 days before and 90 days
after the order date. The order date is in the orders table and the admission date is
in another table. I am using crystal reports. I tried using datediff but something is off.

Thanks
Avatar of Mike McCracken
Mike McCracken

How are you trying to do this?

Are you using a subreport or is te order date a value provided by the user.

mlmcc
Avatar of sashmorhall

ASKER

I was originally using a subreport but I have to create a side by side bar chart that shows the number of admissions before and the number of admission after.
IS the date a parameter to the report?

mlmcc
The order date will be a parameter.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

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
I used datediff("d",order date,admission date) in 1 to 90 and
("d", admission date, order date) in 1 to 90 and it worked fine. I think my original problem was the linking. Thank you very much for you help.


If you used what you claim, it can't work since one of the differences has to be negative.
    datediff("d",order date,admission date) in 1 to 90 and ("d", admission date, order date) in 1 to 90

You could use

ABS(datediff("d",order date,admission date)) in 1 to 90

mlmcc

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.