From shavonne.marietta@studioform.it Tue Mar 6 13:42:53 2007 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 775999FB602 for ; Tue, 6 Mar 2007 09:42:53 -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 02623-07 for ; Tue, 6 Mar 2007 09:42:49 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from smtpout22.attiva.biz (smtpout22.attiva.biz [85.37.16.9]) by postgresql.org (Postfix) with ESMTP id 78C879FB4B5 for ; Tue, 6 Mar 2007 09:42:49 -0400 (AST) Received: from FBCMFE02B15.fbc.local ([192.168.30.161]) by smtpout22.attiva.biz with Microsoft SMTPSVC(6.0.3790.1830); Tue, 6 Mar 2007 14:42:47 +0100 Received: from dream ([88.34.161.130]) by FBCMFE02B15.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Tue, 6 Mar 2007 14:42:46 +0100 Message-ID: <011901c75ff5$57a38930$1102a8c0@dream> Reply-To: "Shavonne Marietta Wijesinghe" From: "Shavonne Marietta Wijesinghe" To: Subject: convert to a string Date: Tue, 6 Mar 2007 14:42:53 +0100 Organization: Studio FORM MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0116_01C75FFD.B8FEF630" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-OriginalArrivalTime: 06 Mar 2007 13:42:46.0719 (UTC) FILETIME=[52FB84F0:01C75FF5] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.32 tagged_above=0 required=5 tests=AWL, BAYES_50, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200703/31 X-Sequence-Number: 27669 This is a multi-part message in MIME format. ------=_NextPart_000_0116_01C75FFD.B8FEF630 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello=20 i have a column N_GEN in postgreSql defined as text. In this coloumn i = insert a number 10 N_GEN (text) =3D 10 on error resume next Set oRs =3D oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN = DESC") If err <> 0 then 'If table not found GetFieldValue =3D "1" else GetFieldValue =3D oRs("N_GEN") + 1 End If But it doesn't add the 1 to my N_GEN How can i set the Recordset to convert the string to a number and then = add 1 to it?? Shavonne Wijesinghe http://www.studioform.it =20 ------=_NextPart_000_0116_01C75FFD.B8FEF630 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello

i have = a column=20 N_GEN in postgreSql defined as text. In this coloumn i insert a number=20 10

N_GEN (text) =3D 10
 
 
on error resume next
  Set = oRs =3D=20 oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN = DESC")
  If=20 err <> 0 then 'If table not = found
   GetFieldValue =3D=20 "1"
  else
   GetFieldValue =3D = oRs("N_GEN") +=20 1
  End If
 
But it doesn't add the 1 to my N_GEN
How can i set the Recordset = to=20 convert the string to a number and then add 1 to it??
 
Shavonne Wijesinghe
http://www.studioform.it
 
 
------=_NextPart_000_0116_01C75FFD.B8FEF630-- From Bart.Degryse@indicator.be Tue Mar 6 13:54:58 2007 Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id C358F9FB262 for ; Tue, 6 Mar 2007 09:54:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 01992-01 for ; Tue, 6 Mar 2007 09:54:40 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from interscan.indicator.com (mail.indicator.be [193.121.199.3]) by postgresql.org (Postfix) with ESMTP id 0D0029FB1CD for ; Tue, 6 Mar 2007 09:54:50 -0400 (AST) Received: from webaccess.indicator.be ([10.100.1.7]) by interscan.indicator.com with InterScan Message Security Suite; Tue, 06 Mar 2007 14:42:15 +0100 Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Tue, 06 Mar 2007 14:54:49 +0100 Message-Id: <45ED80AB.A3DD.0030.0@indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Tue, 06 Mar 2007 14:54:35 +0100 From: "Bart Degryse" To: Subject: Re: convert to a string References: <011901c75ff5$57a38930$1102a8c0@dream> In-Reply-To: <011901c75ff5$57a38930$1102a8c0@dream> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__Part391D9C8B.0__=" X-imss-version: 2.046 X-imss-result: Passed X-imss-approveListMatch: *@indicator.be X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.405 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO, HTML_50_60, HTML_MESSAGE, UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200703/34 X-Sequence-Number: 27672 --=__Part391D9C8B.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable I assume GetFieldValue is the name of a VB function or property get? =20 Try either Set oRs =3D oConn.Execute("SELECT N_GEN::int FROM MyTable ORDER BY N_GEN = DESC") or GetFieldValue =3D cint(oRs("N_GEN")) + 1 or GetFieldValue =3D clng(oRs("N_GEN")) + 1 In the last two cases make sure that the function or property get returns = an int or long Also remember that if oRs("N_GEN") is NULL the sum will also be NULL >>> "Shavonne Marietta Wijesinghe" = 2007-03-06 14:42 >>> Hello=20 i have a column N_GEN in postgreSql defined as text. In this coloumn i = insert a number 10 N_GEN (text) =3D 10=20 =20 =20 on error resume next Set oRs =3D oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN = DESC") If err <> 0 then 'If table not found GetFieldValue =3D "1" else GetFieldValue =3D oRs("N_GEN") + 1 End If =20 But it doesn't add the 1 to my N_GEN How can i set the Recordset to convert the string to a number and then add = 1 to it?? =20 Shavonne Wijesinghe http://www.studioform.it ( http://www.studioform.it/ ) =20 =20 --=__Part391D9C8B.0__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML
I assume GetFieldValue is the name of a VB function or property = get?
 
Try either
  Set oRs =3D oConn.Execute("SELE= CT N_GEN::int FROM MyTable ORDER BY N_GEN DESC")
or
   GetFieldValue =3D = cint(oRs("N_GEN")) + 1
or
   GetFieldValue =3D = clng(oRs("N_GEN")) + 1

In the last two cases make sure that the = function or property get returns an int or long
Also remember that if oRs("N_GEN") is NULL = the sum will also be NULL

>>> "Shavonne Marietta = Wijesinghe" <shavonne.marietta@studioform.it> 2007-03-06 14:42 = >>>
Hello

i have a column = N_GEN in postgreSql defined as text. In this coloumn i insert a number = 10

N_GEN (text) =3D 10
 
 
on error resume next
  Set = oRs =3D oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN DESC")
&= nbsp; If err <> 0 then 'If table not found
   = GetFieldValue =3D "1"
  else
   GetFieldValu= e =3D oRs("N_GEN") + 1
  End If
 
But it doesn't add the 1 to my N_GEN
How can i set the Recordset = to convert the string to a number and then add 1 to it??
 
Shavonne Wijesinghe
http://www.studioform.it
 

 
--=__Part391D9C8B.0__=-- From andreas.kretschmer@schollglas.com Tue Mar 6 13:57:05 2007 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 From shavonne.marietta@studioform.it Tue Mar 6 14:32:19 2007 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 91AB69FB676 for ; Tue, 6 Mar 2007 10:32:19 -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 10719-02 for ; Tue, 6 Mar 2007 10:32:07 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from smtpout14.attiva.biz (smtpout14.attiva.biz [85.37.16.16]) by postgresql.org (Postfix) with ESMTP id B62E19FB5A4 for ; Tue, 6 Mar 2007 10:32:07 -0400 (AST) Received: from FBCMFE02B15.fbc.local ([192.168.30.161]) by smtpout14.attiva.biz with Microsoft SMTPSVC(6.0.3790.1830); Tue, 6 Mar 2007 15:32:06 +0100 Received: from dream ([88.34.161.130]) by FBCMFE02B15.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Tue, 6 Mar 2007 15:32:05 +0100 Message-ID: <01be01c75ffc$3b333f00$1102a8c0@dream> Reply-To: "Shavonne Marietta Wijesinghe" From: "Shavonne Marietta Wijesinghe" To: References: <011901c75ff5$57a38930$1102a8c0@dream> <45ED80AB.A3DD.0030.0@indicator.be> Subject: Re: convert to a string Date: Tue, 6 Mar 2007 15:32:12 +0100 Organization: Studio FORM MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01BB_01C76004.9CA1E5E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-OriginalArrivalTime: 06 Mar 2007 14:32:05.0409 (UTC) FILETIME=[367FC910:01C75FFC] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.214 tagged_above=0 required=5 tests=AWL, BAYES_50, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200703/39 X-Sequence-Number: 27677 This is a multi-part message in MIME format. ------=_NextPart_000_01BB_01C76004.9CA1E5E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable when i try the=20 set oRs =3D oConn.Execute("SELECT N_GEN::int FROM MyTable ORDER BY N_GEN = DESC")=20 it returns 1 and for the rest i doens't change. alsways 10 :( ----- Original Message -----=20 From: Bart Degryse=20 To: pgsql-sql@postgresql.org=20 Sent: Tuesday, March 06, 2007 2:54 PM Subject: Re: [SQL] convert to a string I assume GetFieldValue is the name of a VB function or property get? Try either Set oRs =3D oConn.Execute("SELECT N_GEN::int FROM MyTable ORDER BY = N_GEN DESC") or GetFieldValue =3D cint(oRs("N_GEN")) + 1 or GetFieldValue =3D clng(oRs("N_GEN")) + 1 In the last two cases make sure that the function or property get = returns an int or long Also remember that if oRs("N_GEN") is NULL the sum will also be NULL >>> "Shavonne Marietta Wijesinghe" = 2007-03-06 14:42 >>> Hello=20 i have a column N_GEN in postgreSql defined as text. In this coloumn i = insert a number 10 N_GEN (text) =3D 10=20 on error resume next Set oRs =3D oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN = DESC") If err <> 0 then 'If table not found GetFieldValue =3D "1" else GetFieldValue =3D oRs("N_GEN") + 1 End If But it doesn't add the 1 to my N_GEN How can i set the Recordset to convert the string to a number and then = add 1 to it?? Shavonne Wijesinghe http://www.studioform.it ------=_NextPart_000_01BB_01C76004.9CA1E5E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
when i try the
set oRs =3D=20 oConn.Execute("SELECT N_GEN::int FROM MyTable ORDER BY N_GEN DESC")=20
it returns 1 and for the rest i doens't change. = alsways=20 10
 :(
----- Original Message -----
From:=20 Bart Degryse
Sent: Tuesday, March 06, 2007 = 2:54=20 PM
Subject: Re: [SQL] convert to a = string

I assume GetFieldValue is the name of a VB function or = property=20 get?
 
Try either
  Set oRs =3D = oConn.Execute("SELECT=20 N_GEN::int FROM MyTable ORDER BY N_GEN DESC")
or
   GetFieldValue =3D=20 cint(oRs("N_GEN")) + 1
or
   GetFieldValue =3D=20 clng(oRs("N_GEN")) + 1

In the last two cases make sure that the = function or property get returns an int or long
Also remember that if oRs("N_GEN") is = NULL the=20 sum will also be NULL

>>> "Shavonne Marietta=20 Wijesinghe" <shavonne.marietta@studioform.it> 2007-03-06 14:42=20 >>>
Hello

i have a = column N_GEN in=20 postgreSql defined as text. In this coloumn i insert a number = 10

N_GEN=20 (text) =3D 10
 
 
on error resume = next
  Set oRs =3D=20 oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN=20 DESC")
  If err <> 0 then 'If table not=20 found
   GetFieldValue =3D=20 "1"
  else
   GetFieldValue =3D = oRs("N_GEN") +=20 1
  End If
 
But it doesn't add the 1 to my N_GEN
How can i set the = Recordset to=20 convert the string to a number and then add 1 to it??
 
Shavonne Wijesinghe
http://www.studioform.it
 

 
------=_NextPart_000_01BB_01C76004.9CA1E5E0-- From Bart.Degryse@indicator.be Tue Mar 6 14:38:56 2007 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id C21829FB62C for ; Tue, 6 Mar 2007 10:38:56 -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 11646-02 for ; Tue, 6 Mar 2007 10:38:47 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from interscan.indicator.com (mail.indicator.be [193.121.199.3]) by postgresql.org (Postfix) with ESMTP id 925629F9FE2 for ; Tue, 6 Mar 2007 10:38:47 -0400 (AST) Received: from webaccess.indicator.be ([10.100.1.7]) by interscan.indicator.com with InterScan Message Security Suite; Tue, 06 Mar 2007 15:26:12 +0100 Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Tue, 06 Mar 2007 15:38:45 +0100 Message-Id: <45ED8AFA.A3DD.0030.0@indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Tue, 06 Mar 2007 15:38:34 +0100 From: "Bart Degryse" To: Cc: "Shavonne Marietta Wijesinghe" Subject: Re: convert to a string References: <011901c75ff5$57a38930$1102a8c0@dream><45ED80AB.A3DD.0030.0@indi cator.be> <01be01c75ffc$3b333f00$1102a8c0@dream> In-Reply-To: <01be01c75ffc$3b333f00$1102a8c0@dream> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__Part4662E3FA.0__=" X-imss-version: 2.046 X-imss-result: Passed X-imss-approveListMatch: *@indicator.be X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.395 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO, HTML_50_60, HTML_MESSAGE, UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200703/40 X-Sequence-Number: 27678 --=__Part4662E3FA.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable As Andreas already asked: do you really have a good reason to store = numbers as text If so, show us some more information: table definition, some table data, a = complete (vb?) function/property get, ... anything that is directly = involved. >>> "Shavonne Marietta Wijesinghe" = 2007-03-06 15:32 >>> when i try the=20 set oRs =3D oConn.Execute("SELECT N_GEN::int FROM MyTable ORDER BY N_GEN = DESC")=20 it returns 1 and for the rest i doens't change. alsways 10 :( ----- Original Message -----=20 From: Bart Degryse ( mailto:Bart.Degryse@indicator.be )=20 To: pgsql-sql@postgresql.org=20 Sent: Tuesday, March 06, 2007 2:54 PM Subject: Re: [SQL] convert to a string I assume GetFieldValue is the name of a VB function or property get? =20 Try either Set oRs =3D oConn.Execute("SELECT N_GEN::int FROM MyTable ORDER BY N_GEN = DESC") or GetFieldValue =3D cint(oRs("N_GEN")) + 1 or GetFieldValue =3D clng(oRs("N_GEN")) + 1 In the last two cases make sure that the function or property get returns = an int or long Also remember that if oRs("N_GEN") is NULL the sum will also be NULL >>> "Shavonne Marietta Wijesinghe" = 2007-03-06 14:42 >>> Hello=20 i have a column N_GEN in postgreSql defined as text. In this coloumn i = insert a number 10 N_GEN (text) =3D 10=20 =20 =20 on error resume next Set oRs =3D oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN = DESC") If err <> 0 then 'If table not found GetFieldValue =3D "1" else GetFieldValue =3D oRs("N_GEN") + 1 End If =20 But it doesn't add the 1 to my N_GEN How can i set the Recordset to convert the string to a number and then add = 1 to it?? =20 Shavonne Wijesinghe http://www.studioform.it ( http://www.studioform.it/ ) =20 =20 --=__Part4662E3FA.0__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML
As Andreas already asked: do you really have a good reason to store = numbers as text
If so, show us some more information: table definition, some table = data, a complete (vb?) function/property get, ... anything that is = directly involved.


>>> "Shavonne Marietta Wijesinghe" <shavonne.marie= tta@studioform.it> 2007-03-06 15:32 >>>
when i try the
set oRs =3D = oConn.Execute("SELECT N_GEN::int FROM MyTable ORDER BY N_GEN DESC") =
it returns 1 and for the rest i doens't change. = alsways 10
 :(
----- Original Message -----
= From: Bart Degryse
Sent: Tuesday, March 06, 2007 2:54 = PM
Subject: Re: [SQL] convert to a = string

I assume GetFieldValue is the name of a VB function or property = get?
 
Try either
  Set oRs =3D oConn.Execute("SELE= CT N_GEN::int FROM MyTable ORDER BY N_GEN DESC")
or
   GetFieldValue =3D = cint(oRs("N_GEN")) + 1
or
   GetFieldValue =3D = clng(oRs("N_GEN")) + 1

In the last two cases make sure that the = function or property get returns an int or long
Also remember that if oRs("N_GEN") is NULL = the sum will also be NULL

>>> "Shavonne Marietta = Wijesinghe" <shavonne.marietta@studioform.it> 2007-03-06 14:42 = >>>
Hello

i have a column = N_GEN in postgreSql defined as text. In this coloumn i insert a number = 10

N_GEN (text) =3D 10
 
 
on error resume next
  Set = oRs =3D oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN DESC")
&= nbsp; If err <> 0 then 'If table not found
   = GetFieldValue =3D "1"
  else
   GetFieldValu= e =3D oRs("N_GEN") + 1
  End If
 
But it doesn't add the 1 to my N_GEN
How can i set the Recordset = to convert the string to a number and then add 1 to it??
 
Shavonne Wijesinghe
http://www.studioform.it
 

 
--=__Part4662E3FA.0__=-- From shavonne.marietta@studioform.it Tue Mar 6 14:49:38 2007 Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 205F89FBAB1 for ; Tue, 6 Mar 2007 10:49:38 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 10825-06 for ; Tue, 6 Mar 2007 10:49:12 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from smtpout09.attiva.biz (smtpout09.attiva.biz [85.37.16.7]) by postgresql.org (Postfix) with ESMTP id 82A8D9FB9BA for ; Tue, 6 Mar 2007 10:49:21 -0400 (AST) Received: from fbcmfe02b04.fbc.local ([192.168.30.33]) by smtpout09.attiva.biz with Microsoft SMTPSVC(6.0.3790.1830); Tue, 6 Mar 2007 15:49:11 +0100 Received: from dream ([88.34.161.130]) by fbcmfe02b04.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Tue, 6 Mar 2007 15:49:10 +0100 Message-ID: <01d801c75ffe$9e2ab780$1102a8c0@dream> Reply-To: "Shavonne Marietta Wijesinghe" From: "Shavonne Marietta Wijesinghe" To: Subject: Re: convert to a string Date: Tue, 6 Mar 2007 15:49:17 +0100 Organization: Studio FORM MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01D5_01C76006.FF7CAEA0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-OriginalArrivalTime: 06 Mar 2007 14:49:10.0412 (UTC) FILETIME=[9972D4C0:01C75FFE] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.184 tagged_above=0 required=5 tests=AWL, BAYES_50, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200703/41 X-Sequence-Number: 27679 This is a multi-part message in MIME format. ------=_NextPart_000_01D5_01C76006.FF7CAEA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable i figured it out Set oRs =3D oConn.Execute("SELECT N_GEN FROM " & MyTable & " ORDER BY = N_GEN::INT DESC") thanks to everyone ----- Original Message -----=20 From: Shavonne Marietta Wijesinghe=20 To: pgsql-sql@postgresql.org=20 Sent: Tuesday, March 06, 2007 3:32 PM Subject: Re: [SQL] convert to a string when i try the=20 set oRs =3D oConn.Execute("SELECT N_GEN::int FROM MyTable ORDER BY = N_GEN DESC")=20 it returns 1 and for the rest i doens't change. alsways 10 :( ----- Original Message -----=20 From: Bart Degryse=20 To: pgsql-sql@postgresql.org=20 Sent: Tuesday, March 06, 2007 2:54 PM Subject: Re: [SQL] convert to a string I assume GetFieldValue is the name of a VB function or property get? Try either Set oRs =3D oConn.Execute("SELECT N_GEN::int FROM MyTable ORDER BY = N_GEN DESC") or GetFieldValue =3D cint(oRs("N_GEN")) + 1 or GetFieldValue =3D clng(oRs("N_GEN")) + 1 In the last two cases make sure that the function or property get = returns an int or long Also remember that if oRs("N_GEN") is NULL the sum will also be NULL >>> "Shavonne Marietta Wijesinghe" = 2007-03-06 14:42 >>> Hello=20 i have a column N_GEN in postgreSql defined as text. In this coloumn = i insert a number 10 N_GEN (text) =3D 10=20 on error resume next Set oRs =3D oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY = N_GEN DESC") If err <> 0 then 'If table not found GetFieldValue =3D "1" else GetFieldValue =3D oRs("N_GEN") + 1 End If But it doesn't add the 1 to my N_GEN How can i set the Recordset to convert the string to a number and = then add 1 to it?? Shavonne Wijesinghe http://www.studioform.it ------=_NextPart_000_01D5_01C76006.FF7CAEA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
i figured it out
 
Set oRs =3D oConn.Execute("SELECT N_GEN = FROM " &=20 MyTable & " ORDER BY N_GEN::INT DESC")
 
thanks to everyone
----- Original Message -----
From:=20 Shavonne Marietta = Wijesinghe=20
Sent: Tuesday, March 06, 2007 = 3:32=20 PM
Subject: Re: [SQL] convert to a = string

when i try the
set oRs =3D=20 oConn.Execute("SELECT N_GEN::int FROM MyTable ORDER BY N_GEN DESC")=20
it returns 1 and for the rest i doens't = change. alsways=20 10
 :(
----- Original Message -----
From:=20 Bart Degryse
Sent: Tuesday, March 06, 2007 = 2:54=20 PM
Subject: Re: [SQL] convert to = a=20 string

I assume GetFieldValue is the name of a VB function or = property=20 get?
 
Try either
  Set oRs =3D = oConn.Execute("SELECT=20 N_GEN::int FROM MyTable ORDER BY N_GEN DESC")
or
   GetFieldValue =3D=20 cint(oRs("N_GEN")) + 1
or
   GetFieldValue =3D=20 clng(oRs("N_GEN")) + 1

In the last two cases make sure that = the=20 function or property get returns an int or long
Also remember that if oRs("N_GEN") = is NULL the=20 sum will also be NULL

>>> "Shavonne Marietta=20 Wijesinghe" <shavonne.marietta@studioform.it> 2007-03-06 14:42 = >>>
Hello

i have a = column N_GEN=20 in postgreSql defined as text. In this coloumn i insert a number=20 10

N_GEN (text) =3D 10
 
 
on error resume = next
  Set oRs =3D=20 oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN=20 DESC")
  If err <> 0 then 'If table not=20 found
   GetFieldValue =3D=20 "1"
  else
   GetFieldValue =3D = oRs("N_GEN") +=20 1
  End If
 
But it doesn't add the 1 to my N_GEN
How can i set the = Recordset to=20 convert the string to a number and then add 1 to it??
 
Shavonne Wijesinghe
http://www.studioform.it
 

 
------=_NextPart_000_01D5_01C76006.FF7CAEA0--