[SQL] Datatype Conversion help

2003-07-19 Thread Ramesh Kumar B
How do i can convert character varying type to integer ___ Click below to experience Sooraj R Barjatya's latest offering 'Main Prem Ki Diwani Hoon' starring Hrithik, Abhishek & Kareena http://www.mpkdh.com ---(end of broadcast

Re: [SQL] Datatype conversion help

2003-07-09 Thread listrec
ag von Dmitry Tkach Gesendet: Donnerstag, 10. Juli 2003 00:52 An: Yasir Malik Cc: [EMAIL PROTECTED] Betreff: Re: [SQL] Datatype conversion help Yasir Malik wrote: >I used trim and here's what I came up with: >to_date(trim(to_char(yr, '') || trim(to_char(mn, '00'

Re: [SQL] Datatype conversion help

2003-07-09 Thread Yasir Malik
; >Apparently to_char adds a space to the charecter you are casting. > > > > > I know :-) > And lpad doesn't - that's why I suggested it :-) > > Dima > > > > >On Wed, 9 Jul 2003, Dmitry Tkach wrote: > > > > > > > >>Date: W

Re: [SQL] Datatype conversion help

2003-07-09 Thread Dmitry Tkach
doesn't - that's why I suggested it :-) Dima On Wed, 9 Jul 2003, Dmitry Tkach wrote: Date: Wed, 09 Jul 2003 18:40:37 -0400 From: Dmitry Tkach <[EMAIL PROTECTED]> To: Yasir Malik <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Subject: Re: [SQL] Datatype conversion he

Re: [SQL] Datatype conversion help

2003-07-09 Thread Yasir Malik
ach wrote: > Date: Wed, 09 Jul 2003 18:40:37 -0400 > From: Dmitry Tkach <[EMAIL PROTECTED]> > To: Yasir Malik <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: Re: [SQL] Datatype conversion help > > What about lpad? > > select lpad (7, 2, 0) || '-

Re: [SQL] Datatype conversion help

2003-07-09 Thread Dmitry Tkach
Jul 2003 15:21:33 -0500 From: Richard Rowell <[EMAIL PROTECTED]> To: Yasir Malik <[EMAIL PROTECTED]> Subject: Re: [SQL] Datatype conversion help On Tue, 2003-07-08 at 15:07, Yasir Malik wrote: I've tried to_char(in_val, '99'), and that ret

Re: [SQL] Datatype conversion help

2003-07-09 Thread Richard Huxton
On Tuesday 08 Jul 2003 10:19 pm, Yasir Malik wrote: > Yes, Mr. Nachbaur helped me out. Thanks. I don't think I can do > to_char(, 'MM-DD-) > because the date fields are originally stored as separate integers in my > schema (they have to be that way). I still can't understand why the extra >

Re: [SQL] Datatype conversion help

2003-07-08 Thread Yasir Malik
de my life more miserable. Yasir On Tue, 8 Jul 2003, David Olbersen wrote: > Date: Tue, 8 Jul 2003 14:02:55 -0700 > From: David Olbersen <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: Re: [SQL] Datatype conversion help > > Yasir, > > If this is a date you'

Re: [SQL] Datatype conversion help

2003-07-08 Thread David Olbersen
essage- > From: Yasir Malik [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 08, 2003 1:29 PM > To: [EMAIL PROTECTED] > Subject: Re: [SQL] Datatype conversion help > > > Thank you so much! But my problem is that when I do > to_char(mn, '00') || '-' |

Re: [SQL] Datatype conversion help

2003-07-08 Thread Michael A Nachbaur
r the > the dash. For example, I get > 07- 25- 1994 > > instead of what I want: > 07-25-1994 > > Thanks, > Yasir > > On Tue, 8 Jul 2003, Richard Rowell wrote: > > Date: 08 Jul 2003 15:21:33 -0500 > > From: Richard Rowell <[EMAIL PROTECTED]> > > To:

Re: [SQL] Datatype conversion help

2003-07-08 Thread Yasir Malik
instead of what I want: 07-25-1994 Thanks, Yasir On Tue, 8 Jul 2003, Richard Rowell wrote: > Date: 08 Jul 2003 15:21:33 -0500 > From: Richard Rowell <[EMAIL PROTECTED]> > To: Yasir Malik <[EMAIL PROTECTED]> > Subject: Re: [SQL] Datatype conversion help > > On Tue, 2

Re: [SQL] Datatype conversion help

2003-07-08 Thread Michael A Nachbaur
You want to use: nachbaur=# select to_char(5, '00'); to_char - 05 (1 row) By using "0", you indicate you want leading zeros. See http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=functions-formatting.html for more information. On Tuesday 08 July 2003 01:07 pm, Yasir

[SQL] Datatype conversion help

2003-07-08 Thread Yasir Malik
Suppose I have an integer between 0 and 99 and I want to covert it to string, and pad leading zeros if neccessary. For example, 1 => 01 10 => 10 I've tried to_char(in_val, '99'), and that returns a string that is two charecters, but there isn't a leading zero incase I have the number 2 as input.