Ramco Ramco

Ramco Ramco

  • 439
  • 3.4k
  • 544.5k

Displaying 1901-01-01

Nov 11 2022 10:07 AM

Hi

  I haveb below code in query . I want when count(*) = 0 then it should display it as '' but it is displaying 1901-01-01.

,case when(select count(*) from [PRQS].[dbo].[SentBackLog] where 
	  and ModuleCode = T0.ModuleCode and EntryType = 'Submit') = 0 THEN CAST(''  as datetime)
	  else (select top 1 EntryDate from [PRQS].[dbo].[SentBackLog] where 
	  and ModuleCode = T0.ModuleCode and EntryType = 'Submit') End as 'Last Date'
FROM [EntryLog] T0
  where T0.ModuleCode = 2

Thanks


Answers (7)