Convert Function -
05-24-2005
, 03:17 PM
I am transferring data from MS Access to SQL Server. The fields in Access
that are in currency will not enter directly into SQL Server as money. I
have tried using cast and convert and never one works. The code is:
cnnSQL.Execute "EXEC dbo.spInsertMAR05 " & _
"@accountnumber = '" & accountnumber & "', " & _
"@transactiondate = '" & transactiondate & "', " & _
"@financialclass = '" & financialclass & "', " & _
"@facilityid = '" & facilityid & "', " & _
"@visitnumber = '" & visitnumber & "', " & _
"@dos = '" & dos & "', " & _
"@facilityname = '" & facilityname & "', " & _
"@insname = '" & insname & "', "
"@revenue = convert(money, " & revenue & ", ? );"
The rest is commmented out trying to get the first conversion to money
working.
'"@payment = '" & payment & "', " & _
'"@adjustment = '" & adjustment & "', " & _
'"@dosMonth = '" & dosMonth & "', " & _
'"@dosYear = '" & dosYear & "', " & _
'"@transMonth = '" & transMonth & "', " & _
'"@transYear = '" & transYear & "', " &
'"@transmoyr = '" & transmoyr & "', " & _
'"@dosmoyr = '" & dosmoyr & "', " & _
'"@facilitystate = '" & facilitystate & "';"
"@insname = '" & insname & "', " & _ '**** this field has apostrophes tha
cause crashes as well
Pete Straman
--
Message posted via http://www.sqlmonster.com |