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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Case Statement syntax help 1

Status
Not open for further replies.

allyne

MIS
Feb 9, 2001
410
US
Hi Everyone,

I need to create a case statement like -

CASE
WHEN tblIrdbMonths.[90Days] IS NULL
THEN Update tblIrdbMonths SET tblIrdbMonths.[90Days] = [60Days]
ELSE tblIrdbMonths.[90Days]
END

This statement errors out because of the update statement. Is this possible to do? If so, what is the correct syntax?

Thanks so much in advance for your help!

Cathy
 
Hi, is the [60Days] a column or just a value?
Andel
maingel@hotmail.com
 
UPDATE tblIrdbMonths
SET tblIrdbMonths.[90Days] =
CASE
WHEN tblIrdbMonths.[90Days] IS NULL THEN x
ELSE tblIrdbMonths.[90Days]
END



Andel
maingel@hotmail.com
 
Sorry, on the previous message, replace the x to whatever value you want, like [60days].
Andel
maingel@hotmail.com
 
Can you show me how I this in an IF statement. I am new to this and I can't seem to get it to work. :(

Thanks
Cathy
 
Thanks so much for all your help. Works like a charm!!!

Cathy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top