![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
I am working on SSRS 2005, and I am facing a problem in counting the no of days. My database has many fields but here I am using only two fields They are Placement_Date and Discharge_Date If child is not descharged then Discharge_Date field is empty. I am writing below query to count the number of days but is is not working it is showing the error "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value." select case when convert(datetime,Discharge_Date,103) = '' then |
#4
| |||
| |||
|
|
I am working on SSRS 2005, and I am facing a problem in counting the no of days. My database has many fields but here I am using only two fields They are Placement_Date and Discharge_Date If child is not descharged then Discharge_Date field is empty. I am writing below query to count the number of days but is is not working it is showing the error "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value." select case when convert(datetime,Discharge_Date,103) = '' then datediff(day,CONVERT(datetime,Placement_Date,103), GETDATE()) else datediff(day,CONVERT(datetime,Placement_Date, 103),CONVERT(datetime,Discharge_Date,103)) end NoOfDays from Placement_Details So please tell me where I am wrong? |
![]() |
| Thread Tools | |
| Display Modes | |
| |