Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How to Eliminate Null Columns

$
0
0

HI Team

I want to Remove below Null values , Can you please help me out 

LocationEmployee_CodeInTimeInDateOutTimeOutDate

DPFZR2-M0105:55:5404/01/2014NULLNULL
DPFZR2-M01 22:45:0804/01/2014NULLNULL
DPFZR2-M01 NULLNULL 15:00:0004/01/2014
DPFZR2-M01 NULLNULL 23:02:0204/01/2014

I want Like Below Report

LocationEmployee_CodeInTimeInDateOutTimeOutDate
DPFZR2-M01 05:55:54 04/01/2014 15:00:0004/01/2014
DPFZR2-M01 22:45:0804/01/2014      23:02:0204/01/2014 

My Query Given below 

select c.SubLocation sub,nFingerPrintID as Employee_Code, convert (varchar(10),(case when a.InOut=0 Then dtPunched End),108) InTime,convert(varchar(10),(case when a.InOut=0 Then dtPunched End),101) as InDate, convert (varchar(10),(case when a.InOut=1 Then dtPunched End),108) OutTime,convert(varchar(10),(case when a.InOut=1 Then dtPunched End),101) as OutDate
from MHIATTEND.dbo.loginfo a,MHIATTEND.dbo.TerminalInfo b,MHIATTEND.dbo.SubLocation c 
where a.nTerminalID=b.nTerminalID   and nFingerPrintID='ZR2-M01'  and convert(varchar(10),dtPunched,126) ='2014-04-01' 
and left(c.SubLocation_id,2) = left(b.Name,2) 
group by c.SubLocation,nFingerPrintID,a.InOut,dtPunched

Can you please help to fix this issue.

Thanks


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>