Thread: ...

...

From
Date:
Hi! Good morning!

I have a varchar variable that have inside something like 8:50. I need to broke it and cast each part into two integer
variables(x=8 and y=50). 
If someone know how to do this please tell me to this mail if possible.

Thank's a lot,

Alexandra



Re:

From
Alvaro Herrera Munoz
Date:
On Thu, Jun 12, 2003 at 10:16:13AM +0100, mogas@aveiro-digital.net wrote:

> I have a varchar variable that have inside something like 8:50. I need to
> broke it and cast each part into two integer variables (x=8 and y=50).

> If someone know how to do this please tell me to this mail if possible.

I think you can do something like
SELECT split_part('8:50', ':', 1), split_part('8:50', ':', 2);

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"La realidad se compone de muchos sue�os, todos ellos diferentes,
pero en cierto aspecto, parecidos..." (Yo, hablando de sue�os er�ticos)