|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 12:43 AM
Points: 81,
Visits: 94
|
|
I have One table like this..
Id PatientID Visitid creationTime ServiceAdjustTime --------------------------------------------------------------------------------------- 1 101 1 2013-02-01 17:26:37 2013-02-07 17:26:37 2 101 2 2013-02-02 17:26:37 2013-02-07 17:26:37 3 102 1 2013-02-07 17:26:37 null 4 103 1 2013-02-07 17:26:37 null
If I am selecting data from this one I need to get
If ServiceAdjustTime is null then in that place we will get creation time...
select id,patientid, visitid,ServiceDate from table -----------------------------------------
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Yesterday @ 9:56 AM
Points: 4,418,
Visits: 7,156
|
|
Use the COALESCE function.
John
|
|
|
|