If [ADRCBook Details].RCBDate
column is NULL; I move [Transaction Details].TDJournalDate
column instead of that.
isnull(convert(date,[ADRCBook Details].RCBDate,112),isnull(convert(date,[Transaction Details].TDJournalDate,112),''))
Part of the query I mention above. My problem is I get 1900-01-01. I need blank ('') if both of the columns are NULL.
CodePudding user response:
If I understood correctly what you need:
isnull(cast(convert(date, isnull([ADRCBook Details].RCBDate, [Transaction Details].TDJournalDate), 112) as varchar), '')
Of course instead of cast
you can use convert
. The main point is to discard the date
type information.