RE: Date function

RE: Date function

 

  

Try this.


select DAY(LAST_DAY(CURRENT_DATE)) from SYSIBM.SYSDUMMY1;

Regards,
Gopi

Gopi Krishna Vemula
Tata Consultancy Services
Mailto: gopikrishna.[Email address protected]
Website: http://www.tcs.com



"JITENDRA PRAJAPATI "
<db2udbdba-ezmlmshield-x17865101.[Email address protected]
10/30/2006 04:11 PM

To
"LazyDBA Discussion" <[Email address protected]
cc

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.techmahindra.com/Disclaimer.html</a> externally and <a href="
http://tim.techmahindra.com/Disclaimer.html
">http://tim.techmahindra.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

ForwardSourceID:NT0000AB0E
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you



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