Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Please Help Me Expand / Collapse
Author
Message
Posted Thursday, February 07, 2013 7:11 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC 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
-----------------------------------------


  Post Attachments 
post1.txt (1 view, 582 bytes)
Post #1417055
Posted Thursday, February 07, 2013 7:19 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 9:56 AM
Points: 4,418, Visits: 7,156
Use the COALESCE function.

John
Post #1417057
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse