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

Problem with DB2 BO Universe case statement

Status
Not open for further replies.

DrSmyth

Technical User
Jul 16, 2003
557
GB
Hi, I'm doing a bit of universe work and haveing a few probs with a case statement, basically if an events happened before a certain time then i wanna add some days onto a date, my syntax is as follows:

Code:
case when date(DIRY_REV.TRIG_TS)<= date(01/09/2005) then date(DIRY_REV.TRIG_TS) + 7 Days Else date(DIRY_REV.TRIG_TS) end case

Can anybody spot where i'm going wrong??

Thanks
 
The only things I can see wrong is that you should end a CASE statement with END (for DB2), and not END CASE and that the literal date should be within single quotes.

case when date(DIRY_REV.TRIG_TS)<= date('01/09/2005') then date(DIRY_REV.TRIG_TS) + 7 Days Else date(DIRY_REV.TRIG_TS) end


If that does noe solve your problem, send us the error message and someone will help.

Brian
 
Cheers Brian, Putting the dat in single quotes has worked, thanks for the tip...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top