June 17, 2010 at 6:43 am
Hello and good morning,
I'm doing a report in SSRS and trying to calculate the number of days between the patient's re-admission and the original admission date.
here's my formula
=FORMAT (DateDiff("DAY", Fields!ReAdmitDate.Value, Fields!AdmitDate.Value) >= 30)
tried =(DateDiff("DAY", Fields!ReAdmitDate.Value, Fields!AdmitDate.Value) >= 30)
but still no luck, the field comes with "#Error
the type of data from the DB is "DATE" , format is 06/17/2010 12:00:00 AM
Any idea what I'm missing in my code??
Thanks
June 17, 2010 at 6:46 am
are you trying to get a boolean value?
DateDiff returns an integer, your example seems to be doing this:
FORMAT (DateDiff("DAY", Fields!ReAdmitDate.Value, Fields!AdmitDate.Value) >= 30)
'would be the same as this witht he right dates
FORMAT(34>= 30)
what value do you want to be int he field?
Lowell
June 17, 2010 at 6:50 am
Hey Lowell, thanks for your help, I'm trying to get the number of days less or equal 30 days.
the report supposes to show the patients whose got admitted within 30 days only, that's why I'm calculating the days
June 17, 2010 at 7:13 am
Thanks, i did it through a T-SQL statement, I hate SSRS expressions 😉
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply