dbTalk Databases Forums  

Convert Function

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Convert Function in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Pete Straman Straman via SQLMonster.com
 
Posts: n/a

Default 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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.