Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if...then 1

Status
Not open for further replies.

sexydog

Programmer
Jul 9, 2002
176
0
0
GB
can i use an if then in the where clause

i want to select amount but if it is ='' then i want to replace it with amount = 0.00
 
U can make use of CASE Statements.

Please post your full query.

Anway this is how its done

SELECT Amount FROM tablename
WHERE Amount=(CASE WHEN Amount ='' THEN 0 END)


dbtech
 
try isnull as in:
select isnull(amount,0.0)....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top