sql server 2008 - SQL View, replace a NULL Value -


in sql have datefield thats showing current month data. of dates null , replace null date somethng fn now() date somehow. can guide me updating nulls in query? im using ms sql 2008 r2.

select     top (100) percent dbo.[001_subitem_price].subitem, { fn now() } date, dbo.potable.date datefield         dbo.[001_subitem_price] left outer join                       dbo.potable on dbo.[001_subitem_price].subitem = dbo.potable.item     (month(dbo.potable.date) = month(getdate())) or                       (month(dbo.potable.date) null) group dbo.[001_subitem_price].subitem, dbo.potable.date order dbo.[001_subitem_price].subitem 

enter image description here

just use:

...coalesce(datefield, getdate()) datefield


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -