pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dan Feiveson <danf@datajoe.com>
To: Judith Altamirano Figueroa <jaltamirano@correolux.com.mx>
To: pgsql-sql@postgresql.org
Subject: Re: cast
Date: Fri, 14 Oct 2005 12:20:07 -0600
Message-ID: <011a01c5d0eb$e7dfc120$fb04030a@CCPlanet.Com> (raw)
References: <1129313323.4577.55.camel@Desarrollo>

I believe int8(n.udf4) will do the trick for you.


----- Original Message ----- 
From: "Judith Altamirano Figueroa" <jaltamirano@correolux.com.mx>
To: <pgsql-sql@postgresql.org>
Sent: Friday, October 14, 2005 12:08 PM
Subject: [SQL] cast


> Hello I have a query that ran in 7.0.2, but in 8.0.1 does not, the query
> is the next:
> 
> 
> 
> select n.factura,
> n.venta_neta,
> c.nombre_cli || ' ' || c.apellido_pat_cli || ' ' || coalesce
> (c.apellido_mat_cli,''), 
> date(n.fecha_hora_factura),
> o.nombre_oft
> from nota_venta n,
> clientes c,
>                  oft_central o
> where date(n.fecha_hora_factura) >= '2005-10-01' and
> date(n.fecha_hora_factura) <= '2005-10-14' and
> n.id_cliente = c.id_cliente and
> cast(n.udf4 as integer) = o.id_oft_central and
> n.factura is not null and
>                  n.s_factura != 'T'
> order by o.nombre_oft";
> 
> it aparently returns an error because the cast, but I need to do the
> cast, does somebody knows how can I change the cast but with the same
> result, thnks!!!!
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faq



view thread (5+ messages)

Message-ID: <011a01c5d0eb$e7dfc120$fb04030a@CCPlanet.Com>
Permalink:  ../011a01c5d0eb$e7dfc120$fb04030a@CCPlanet.Com/
Also on:    postgresql.org/message-id/011a01c5d0eb$e7dfc120$fb04030a@CCPlanet.Com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: danf@datajoe.com, jaltamirano@correolux.com.mx
  Subject: Re: cast
  In-Reply-To: <011a01c5d0eb$e7dfc120$fb04030a@CCPlanet.Com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox