RE: Date function

RE: Date function

 

  

There is scalar function on db2 for z/os last_day('date-expression')
that returns the last day of the given month.

Maybe in version 9 Fixpak 2

-----Original Message-----
From: JITENDRA PRAJAPATI
[mailto:db2udbdba-ezmlmshield-x17865101.[Email address protected]
Sent: Monday, October 30, 2006 12:42 PM
To: LazyDBA Discussion
Subject: RE: Date function


Hi Rohini, try this

Kamal I think you wanna get the last day of the current month :)

SELECT DATE(SUBSTR( DIGITS(YEAR (CURRENT DATE + 1 MONTH)),7,4) || '-' ||
SUBSTR( DIGITS(MONTH (CURRENT DATE + 1 MONTH)),9,2) || '-' || '01' ) -
1 DAY AS "LAST DAY OF MONTH" FROM SYSIBM.SYSDUMMY1


Thanks and regards,
Jitendra

-----Original Message-----
From: Rohini S Kumar
[mailto:db2udbdba-ezmlmshield-x68472445.[Email address protected]
Sent: Friday, October 27, 2006 3:57 PM
To: LazyDBA Discussion
Subject: Re: Date function

I am sorry

Try this
Select dateadd(ms, -3, DATEADD(mm, DATEDIFF(mm, 0, getdate())+1, 0))

Rohini

----- Original Message -----
From: "Rohini S Kumar "
<db2udbdba-ezmlmshield-x2548435.[Email address protected]
To: "LazyDBA Discussion" <[Email address protected]
Sent: Friday, October 27, 2006 3:30 PM
Subject: Re: Date function


> In MSSQL
>
> Select dateadd(ms, -3, DATEADD(yy, DATEDIFF(m, 0, getdate())+1, 0))
>
> will return you last day of current month. With this idea you can try
for
> DB2
>
> Rohini
> ----- Original Message -----
> From: "KAMAL " <db2udbdba-ezmlmshield-x43068854.[Email address
protected]
> To: "LazyDBA Discussion" <[Email address protected]
> Sent: Friday, October 27, 2006 2:33 PM
> Subject: Date function
>
>
>>
>> Hi All,
>>
>> How to get a maximum days from a month?
>> For ex: days of january 2003 we get result 31
>>
>>
>> Thanks in advance,
>> Kamal.
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
>> To post a dba job: http://jobs.lazydba.com
>> To Subscribe : http://www.LazyDBA.com
>> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>>
>>
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>



---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


========================================================================
====================================================

Tech Mahindra, formerly Mahindra-British Telecom.

Disclaimer:

This message and the information contained herein is proprietary and
confidential and subject to the Tech Mahindra policy statement, you may
review at <a
href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahind
ra.com/Disclaimer.html</a> externally and <a
href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahind
ra.com/Disclaimer.html</a> internally within Tech Mahindra.

========================================================================
====================================================


---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html

__________________________________________________________________________________________________________________________________

Standard Bank Disclaimer and Confidentiality Note

This e-mail, its attachments and any rights attaching hereto are, unless the context clearly indicates otherwise, the property of Standard Bank Group Limited
and/or its subsidiaries ("the Group"). It is confidential, private and intended for the addressee only. Should you not be the addressee and receive this e-mail by
mistake, kindly notify the sender, and delete this e-mail, immediately and do not disclose or use same in any manner whatsoever. Views and opinions
expressed in this e-mail are those of the sender unless clearly stated as those of the Group. The Group accepts no liability whatsoever for any loss or
damages whatsoever and howsoever incurred, or suffered, resulting, or arising, from the use of this email or its attachments. The Group does not warrant the integrity
of this e-mail nor that it is free of errors, viruses, interception or interference. Licensed divisions of the Standard Bank Group are authorised financial services providers
in terms of the Financial Advisory and Intermediary Services Act, No 37 of 2002 (FAIS).
For information about the Standard Bank Group Limited visit our website http://www.standardbank.co.za
___________________________________________________________________________________________________________________________________

DB2 & UDB email list listserv db2-l LazyDBA home page