X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4C73DD9736 for ; Fri, 14 Oct 2005 15:28:00 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 61766-09 for ; Fri, 14 Oct 2005 18:27:56 +0000 (GMT) Received: from hq.ncbr.com (unknown [207.174.141.130]) by svr1.postgresql.org (Postfix) with ESMTP id D5575D967C for ; Fri, 14 Oct 2005 15:27:56 -0300 (ADT) Received: from enitz2 (unknown [216.183.117.62]) by hq.ncbr.com (Postfix) with SMTP id C2854153566; Fri, 14 Oct 2005 13:17:01 -0600 (MDT) Message-ID: <011a01c5d0eb$e7dfc120$fb04030a@CCPlanet.Com> From: "Dan Feiveson" To: "Judith Altamirano Figueroa" , References: <1129313323.4577.55.camel@Desarrollo> Subject: Re: cast Date: Fri, 14 Oct 2005 12:20:07 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.053 required=5 tests=[AWL=0.003, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/191 X-Sequence-Number: 23044 I believe int8(n.udf4) will do the trick for you. ----- Original Message ----- From: "Judith Altamirano Figueroa" To: 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