RE: Date function

RE: Date function

 

  

Hi all,
I have another related to DATE
I fI have a TIMESTAMP field with aprox 4 million records what is the best way to change to DATE what is the impect on my DB?
any help will be wellcome, never get into this




Atte:
Guillermo J.. Moreno M.
DBA y WebSphere Support
Softtek Mexico

IMPORTANTE: Los documentos y archivos que se acompañan a esta transmisión, contienen información confidencial la cual es legalmente secreta. Esta información puede ser usada únicamente por el destinatario cuyo nombre aparece inserto en esta transmisión. Si usted ha recibido esta transmisión por error, notifíquenos inmediatamente por esta misma vía, y borre el archivo y sus anexos. Se hace de su conocimiento por medio de esta nota, que cualquier divulgación, copia, distribución o toma de cualquier acción derivada de la información confiada en esta transmisión, queda estrictamente prohibido, el incumplimiento de esto genera responsabilidad legal.
IMPORTANT: The documents and files attached to this transmission contain confidential information that must be kept secret by law. This information is for the exclusive use of the specified recipient whose name appears in this transmission. If you have received this message by mistake, please notify us immediately by return e-mail and delete the file and its attachments. You are hereby notified that any dissemination, copying, distribution or adoption of any action arising from the confidential information contained herein is strictly prohibited. Any violation will be penalized by law.

________________________________

From: gopikrishna [mailto:db2udbdba-ezmlmshield-x1926763.[Email address protected]
Sent: Tue 10/31/2006 03:01 AM
To: LazyDBA Discussion
Subject: 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




---------------------------------------------------------------------
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




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