Home > database >  Trying to show a date as blank in a total row
Trying to show a date as blank in a total row

Time:07-15

SQL Server : when I select my totals row, for date I select ' ' but it gets converted to 1/1/1900 because it is a date column for all other rows. What can i do to make it say blank.

Here is an example of my total row. some of the blank values are dates in the detail.

UNION ALL 
SELECT  TOP 99999999
AddUpdate
 , Members_SourceCode 
 ,  YearMonth    ' Total Month' 
, ' ' 
, ' ' 
, ' ' 
, ' ' 
,  ' ' 
, ' ' 
, ' ' 
, ' ' 
, ' ' 
, ' ' 
, ' ' 
, ' ' 
, COUNT(Members_sourceCode) 

GROUP BY AddUpdate, Members_SourceCode, YearMonth
ORDER BY AddUpdate, Members_SourceCode, YearMonth

CodePudding user response:

Nothing represents the default value of a data type. The default value depends on whether the variable is of a value type or of a reference type.

Nothing keyword (Visual Basic) - Remarks

With VB.NET and EF 6.X to save null is:

Dim nullableData As New Nullable(Of Date)

CodePudding user response:

I'm trying to show blank on a total line, on the detail line it's a date. On the total line it's 1/1/1900 so can be confusing. I would like to show blank on the total line.

  • Related