January 8, 2013 at 2:34 pm
Preety basic(I Think)but I have a view where a date can be null
I want to to 12/31/2050 in the date if null else I want the date that is in the field
Thanks In Advance
Joe
January 8, 2013 at 2:45 pm
Does this work?
ISNULL(YourDate, '2050-12-31')
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
January 8, 2013 at 2:46 pm
You have 2 other options: use CASE a_column when null then 'the date' else a_column end
also - coalesce(a_column,'the_date') - maybe you need to cast
Kindest Regards,
Damian Widera
SQL Server MVP,
MCT, MCSE Data Platform, MCSD.NET
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply