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 7, 2013 7:11 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Saturday, April 19, 2014 4:55 AM
Points: 84, Visits: 104
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 7, 2013 7:19 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 5:17 AM
Points: 5,230, Visits: 9,457
Use the COALESCE function.

John
Post #1417057
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse