Refer the below sample rtest query to handel Date value as empty or in Null condition to show blank value.
SQL
DECLARE @Test AS TABLE(LastName VARCHAR(50),Name VARCHAR(50),FatherName VARCHAR(50),Birthday DATE,Address VARCHAR(50),ComeDate DATE)
INSERT INTO @Test VALUES('Pulodov','Rustam','Abdulloevich','12/22/1987','city Dushanbe','')
INSERT INTO @Test VALUES('Siliev','Firuzjon','','6/16/1988','city Hisor','11/29/2017')
INSERT INTO @Test VALUES('Asrory','Yatim','','2/6/1978','city Kulob',NULL)
SELECT LastName
,Name
,FatherName
,Birthday
,Address
,CASE WHEN LTRIM(RTRIM(ComeDate)) = '1900-01-01' then '' else ISNULL(CONVERT(VARCHAR(30),ComeDate,121),'') end ComeDate
FROM @Test
Output
LastName |
Name |
FatherName |
Birthday |
Address |
ComeDate |
Pulodov |
Rustam |
Abdulloevich |
1987-12-22 |
city Dushanbe |
|
Siliev |
Firuzjon |
|
1988-06-16 |
city Hisor |
2017-11-29 |
Asrory |
Yatim |
|
1978-02-06 |
city Kulob |
|