Question

  Asked: Apr 4 2008   10:23 AM GMT
  Asked by: Mr. SEA


Date Function AS400


AS/400 DB2, iSeries development

I need the Date function of DB2.

Actually I want to subtract the Date however I have used the follwoing:

select current date -1 from sysibm.sysdummay1;

But It occures an error.

Is there any way to subtract the date in the query.


I am using iSeries DB2 AS400

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
+2
Click to Vote:
  •   2
  •  0



Dear Mr. SEA,

You must subtract a duration of 1 DAY to the date, then your expression must look like this:

Select CurDate() - 1 Days from SysIBM.SysDummy1

The error ocurred because SQL took that one alone as numeric instead of a date type.

Best regards,

Gerardo.

Thanks Gerardo,

I had found from of another site the solution that was different but subtraction was successfull. I have checked your given query this also working.

May I have your email address please:


Thank you v.much.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register