How
to convert varchar data type column to int in SQL Server while querying?
There are two ways to convert varchar data type column to int while writing query statements.
- CAST
- CONVERT
Examples :
CONVERT(int,discountfee)
CAST(discountfee
as int)
Here discountfee
is column name and int declared as
data type for column varchar data type discountfee.
No comments:
Post a Comment