From: Rob Christiansen on
ok, in below script i extract a feild from *.mdb file (in this case
fdebit, which was established as a string variable) and convert its
value temporarily to a currency or float value. I got this off the
on-line help, but they didn't provided any sample code. I want to add
values, not cat them
--------------------------------------------------------------------
while(! (rs.EOF))
{ //567
if( rs("id").Value == 22)
{ //33
string1 = rs("fdebit").Value;
string2 = rs("fcredit").Value;
break;
} //33

rs.MoveNext( )
} //567

Response.Write( "string1 = "+ string1 +"<br>" ) //Response.end();

CONVERT( currency(8), string1 ) ///<------------------- it takes the
variable "string1" aND CONVERTS IT TO TYPE-CURRENCY, but where is the
new value stored?
Response.Write( "??? = "+ ??? +"<br>" )


------------------------------------------------------ or would I do
something like this? ------------------------------------
NewValue = CONVERT( currency(8), string1 )
NewValue2 = CONVERT( currency(8), string2 )
string3 = NewValue + NewValue2 ;

Response.Write( "string3 = "+ string3 +"<br>" ) //Response.end();


crazyswede

*** Sent via Developersdex http://www.developersdex.com ***
From: Sean Kinsey on
On Apr 25, 7:57 pm, Rob Christiansen <robb_christian...(a)q.com> wrote:
> ok, in below script i extract a feild from *.mdb file (in this case
> fdebit, which was established as a string variable) and convert its
> value temporarily to a currency or float value. I got this off the
> on-line help, but they didn't provided any sample code. I want to add
> values, not cat them
> --------------------------------------------------------------------
> while(! (rs.EOF))
> { //567
> if( rs("id").Value == 22)
> { //33
> string1 = rs("fdebit").Value;
> string2 = rs("fcredit").Value;
> break;
>
> } //33
>
> rs.MoveNext( )
>
> } //567
>
> Response.Write( "string1 = "+ string1 +"<br>" ) //Response.end();
>
> CONVERT( currency(8), string1 ) ///<------------------- it takes the
> variable "string1" aND CONVERTS IT TO TYPE-CURRENCY, but where is the
> new value stored?
> Response.Write( "??? = "+ ??? +"<br>" )
>
> ------------------------------------------------------ or would I do
> something like this? ------------------------------------
> NewValue = CONVERT( currency(8), string1 )
> NewValue2 = CONVERT( currency(8), string2 )
> string3 = NewValue + NewValue2 ;
>
> Response.Write( "string3 = "+ string3 +"<br>" ) //Response.end();

CONVERT is an SQL command and is therefor used as part of the SQL.
sql="UPDATE foo SET bar = CONVERT(currency(8)," + 1234 + ")";