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
just use:
...coalesce(datefield, getdate()) datefield
Comments
Post a Comment