Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (17.6k points)

I am trying to do 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 I am not able to resolve it, the field comes with "#Error

Data type from the DB is "DATE" , format is 06/17/2010 12:00:00 AM

Any idea what I'm missing in my code?? 

1 Answer

0 votes
by (47.2k points)

If your column data type is DateTime, your DateDiff expression should look like this:

=DateDiff(DateInterval.Minute, Fields!tour_start_time.Value, Fields!tour_end_time.Value)

or

=DateDiff("n", Fields!tour_start_time.Value, Fields!tour_end_time.Value)

Generally, DateDiff returns an integer. Your example seems to be doing this:

FORMAT (DateDiff("DAY", Fields!ReAdmitDate.Value, Fields!AdmitDate.Value) >= 30)

FORMAT(34>= 30)

 Check out MSBI training that helps you enhance your skills.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Feb 27, 2020 in BI by Vaibhav Ameta (17.6k points)
0 votes
1 answer
0 votes
1 answer
asked Feb 27, 2020 in BI by Vaibhav Ameta (17.6k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...