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-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Yesterday @ 3:35 AM
Points: 198, Visits: 106
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 @ 4:13 AM
Points: 5,438, Visits: 10,143
Use the COALESCE function.

John
Post #1417057
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse