Hi Manny

Try:

select right(varchar(100+date_part ('month',date('12/05/2006'))),2)

Regards
Dave

-----Original Message-----
From: Manny [mailto:mantas44@hotmail.com]
Sent: 31 May 2006 11:53
To: info-ingres@cariboulake.com
Subject: [Info-ingres] SQL - Using date_part function....


Hi,

Is there a function I can use with date_part to return the month in
two digits i.e with a leading zero

Currently I get:
1> select date_part ('month',date('12/05/2006'))
+------+
|col1 |
+------+
| 5|
+------+

But I need the month to be returned as '05'

Cheers,

Manny

_______________________________________________
Info-ingres mailing list
Info-ingres@cariboulake.com
http://mailman.cariboulake.com/mailm...py/info-ingres


**********************************************************************

The information contained in this e-mail is confidential and intended only
for the use of the addressee. If the reader of this message is not the
addressee, you are hereby notified that you have received this e-mail in
error and you must not copy, disseminate, distribute, use or take any action
as a result of the information contained in it.

If you have any queries, please contact the IT Service Desk on 1870
(01384-275454).

postmaster@npower.com

**********************************************************************


**********************************************************************

This e-mail is provided for general information purposes only and does not constitute investment or transactional advice. For the avoidance of doubt the contents of this email are subject to contract and will not constitute a legally binding contract.

The information contained in this e-mail is confidential and intended only for the use of the addressee. If the reader of this message is not the addressee, you are hereby notified that you have received this e-mail in error and you must not copy, disseminate, distribute, use or take any action as a result of the information contained in it.

If you have received this e-mail in error, please notify postmaster@npower.com (UK 01384 275454) and delete it immediately from your system.

Neither Npower nor any of the other companies in the RWE Npower group from whom this e-mail originates accept any responsibility for losses or damage as a result of any viruses and it is your responsibility to check attachments (if any) for viruses.
Npower Limited Registered office: Windmill Hill Business Park, Whitehill Way, Swindon SN5 6PB. Registered in England and Wales: number 3653277. This e-mail may be sent on behalf of a member of the RWE Npower group of companies.

**********************************************************************