Re: convert to a string
От | Shavonne Marietta Wijesinghe |
---|---|
Тема | Re: convert to a string |
Дата | |
Msg-id | 01be01c75ffc$3b333f00$1102a8c0@dream обсуждение исходный текст |
Ответ на | convert to a string ("Shavonne Marietta Wijesinghe" <shavonne.marietta@studioform.it>) |
Ответы |
Re: convert to a string
|
Список | pgsql-sql |
when i try the
set oRs = 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 DegryseSent: Tuesday, March 06, 2007 2:54 PMSubject: Re: [SQL] convert to a stringI assume GetFieldValue is the name of a VB function or property get?Try eitherSet oRs = oConn.Execute("SELECT N_GEN::int FROM MyTable ORDER BY N_GEN DESC")orGetFieldValue = cint(oRs("N_GEN")) + 1orGetFieldValue = clng(oRs("N_GEN")) + 1
In the last two cases make sure that the function or property get returns an int or longAlso 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) = 10on error resume next
Set oRs = oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN DESC")
If err <> 0 then 'If table not found
GetFieldValue = "1"
else
GetFieldValue = oRs("N_GEN") + 1
End IfBut 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
В списке pgsql-sql по дате отправления: