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
How do I set the value of a textbox that is bound to a required datetime field to blank so it doesnt show the default date?
Automatically run an application as another user
how can I override the DateTime class to add a custom method??
Cancel button on form
Filte removing records from query?
New Exchange 2007 installation after exchange server 2000 fail ?
Need help understranding 'WHERE EXISTS' and 'WHERE NOT EXISTS'
Remotely Installing Windows Server 2008
Form_Current or Form_Open
Problem with Microsoft Rich textbox control 6.0 (SP4)