If you need to insert the value into a db try the scalar function CONVERT in
your sql statement.

The format of the CONVERT function is:

CONVERT(value_exp, data_type)

The function returns the value specified by value_exp converted to the
specified data_type, where data_type is one of the following keywords:
SQL_BIGINT
SQL_BINARY
SQL_BIT
SQL_CHAR
SQL_DATE
SQL_DECIMAL
SQL_DOUBLE
SQL_FLOAT
SQL_INTEGER
 SQL_LONGVARBINARY
SQL_LONGVARCHAR
SQL_REAL
SQL_SMALLINT
SQL_TIME
SQL_TIMESTAMP
SQL_TINYINT
SQL_VARBINARY
SQL_VARCHAR

The ODBC syntax for the explicit data type conversion function does not
support specification of conversion format. If specification of explicit
formats is supported by the underlying data source, a driver must specify a
default value or implement format specification.


----- Original Message -----
From: Richard Banks <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Sent: Tuesday, January 30, 2001 4:53 PM
Subject: String to Int


> is there a way [ie. a cf function ]to convert a string to an integer.
let's
> say a user enters the string '1976' , and i want to process that string as
> the integer 1976.
> any help would be greatly appreciated. thanks
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to