Microsoft
Software
Hardware
Network
Question : sql question
I have this section in my sql script:
ISNULL(lot_loc.unit_cost, item.avg_u_cost) as [Unit Cost]
it works very well but in some cases lot_loc also = 0.0 in which case I'd also like it to pull the value from item.avg_u_cost.
How can I do this?
Answer : sql question
use this instead of the above
case when lot_loc.unit_cost is null or lot_loc.unit_cost =0 then item.avg_u_cost ELSE lot_loc.unit_cost END as as [Unit Cost]
Random Solutions
Out of resources error when moving lots of files
Date Format problem in Microsoft Access 2000
Terminal Server installation on Windows Essential Business Server 2008.
Boolean as criteria in Access 2003 query
VISTA ULTIMATE - 64bit downgrade to 32 bit ??s
FoxPro Code for creating text string for Intelligent Mail Barcode
I need help appending text to cells in excel
Basic steps for a Zip code search ASP.NET VB, MS SQL 2008
SQL Count Query In a Main Query
Outlook 2007 connecting to Exchange 2010. Cannot connect to email folders.