Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id E75459FBA6D for ; Tue, 6 Mar 2007 09:57:05 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 05373-02-2 for ; Tue, 6 Mar 2007 09:56:58 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.174]) by postgresql.org (Postfix) with ESMTP id 0207A9FBA70 for ; Tue, 6 Mar 2007 09:56:57 -0400 (AST) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis), id 0ML29c-1HOa9r2IDV-0004Jp; Tue, 06 Mar 2007 14:56:54 +0100 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1HOa9c-00066a-00 for pgsql-sql@postgresql.org; Tue, 06 Mar 2007 14:56:36 +0100 Date: Tue, 6 Mar 2007 14:56:36 +0100 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: convert to a string Message-ID: <20070306135636.GM10330@a-kretschmer.de> References: <011901c75ff5$57a38930$1102a8c0@dream> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <011901c75ff5$57a38930$1102a8c0@dream> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: kundenserver.de abuse@kundenserver.de login:51ea9561fc3f6d9539a2acd743e4748c X-Provags-ID2: V01U2FsdGVkX19ad1B7TWKFXeGqmdk6tzHi46L2sqBTELYIYdN ePerNY3yuO2/yAy4MKb0WIrTTacmVyuVwdg14qDNTJozEjyafG 2ethxWRm5TFNr9CEOCpE16rNPSGkv2Z X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.318 tagged_above=0 required=5 tests=AWL, BAYES_50, SPF_HELO_PASS X-Spam-Level: X-Archive-Number: 200703/36 X-Sequence-Number: 27674 am Tue, dem 06.03.2007, um 14:42:53 +0100 mailte Shavonne Marietta Wijesinghe folgendes: > Hello > > i have a column N_GEN in postgreSql defined as text. In this coloumn i insert a > number 10 Why do you store numbers as text? > > N_GEN (text) = 10 > > > on error resume next > Set oRs = oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN DESC") > > But it doesn't add the 1 to my N_GEN You can't add a number to a string. > How can i set the Recordset to convert the string to a number and then add 1 to > it?? You can try to cast it to int: test=# select '10'::text; text ------ 10 (1 row) test=*# select '10'::text::int; int4 ------ 10 (1 row) In your Query, change 'SELECT N_GEN FROM' to 'SELECT N_GEN::int FROM'. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net