Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > IBM DB2 > Re: Date functi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 5 Topic 8860 of 9520
Post > Topic >>

Re: Date function in DB2 V8.1 for Z/OS

by Lennart <Erik.Lennart.Jonsson@[EMAIL PROTECTED] > May 6, 2008 at 03:11 PM

On May 6, 10:56 pm, JAW <jwill...@[EMAIL PROTECTED]
> wrote:
> I need to get the first day of the previous month in a query.
>
> I thought CURRENT DATE and DAYOFMONTH would allow me to da it but it
> is noe
>
> WHERE DTXL >= 1st day of previous month
>
> Anyone got a good idea?

I'm not familiar with DB2 for Z/OS but do you mean something like:

[lelle@[EMAIL PROTECTED]
 db2 "values current_date - 1 month -
day(current_date) days + 1 day"

1
----------
04/01/2008

  1 record(s) selected.

/Lennart
 




 5 Posts in Topic:
Date function in DB2 V8.1 for Z/OS
JAW <jwilliam@[EMAIL P  2008-05-06 13:56:04 
Re: Date function in DB2 V8.1 for Z/OS
Lennart <Erik.Lennart.  2008-05-06 15:11:36 
Re: Date function in DB2 V8.1 for Z/OS
"The Boss" <  2008-05-07 01:16:00 
Re: Date function in DB2 V8.1 for Z/OS
Tonkuma <tonkuma@[EMAI  2008-05-06 16:21:54 
Re: Date function in DB2 V8.1 for Z/OS
Tonkuma <tonkuma@[EMAI  2008-05-06 19:52:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 20:56:20 CST 2008.