Home > Software engineering >  Help, use vba write SQL server data type conversion problem
Help, use vba write SQL server data type conversion problem

Time:11-19

Initial setup varchar (MAX) type is not sure which is the digital type

Use vba to write data into the SQL server 2008 r2, want to have the type of data columns, from varchar (MAX) type converted to a decimal number, but export to several are changed, a lot of times larger, solving

CodePudding user response:

Deposit in CStr function converts the original digital type to string type deposit varchar field
Read again when using Int function converts a string type numeric type
Such as:
The written
.
Rs! F_str=CStr (123)
.
Read the
Dm rs_int as integer
.
Rs_int=int (rs! F_str & amp; "")
.

CodePudding user response:

reference 1st floor still human response:
deposit in CStr function converts the original digital type to string type deposit varchar field
Read again when using Int function converts a string type numeric type

Rs_int=int (rs! F_str & amp; "")
.


I want to put the inside of the database into a numeric type, convenient calculation
  •  Tags:  
  • VBA