Re: convert function
From: Bob Barrows (reb01501_at_NOyahoo.SPAMcom)
Date: 02/21/04
- Next message: Bob Barrows: "Re: Posting a value for a field in select option"
- Previous message: Stuart Palmer: "Re: Beginner Question."
- In reply to: shank: "convert function"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 21 Feb 2004 08:09:03 -0500
shank wrote:
> I'm getting the following error...
>
> Microsoft OLE DB Provider for SQL Server error '80040e07'
> Disallowed implicit conversion from data type varchar to data type
> money, table 'wsOrders', column 'ShippingCost'. Use the CONVERT
> function to run this query.
>
> SQL = SQL & "Values ('" & io_ShippingCost & "')"
> DataConn.Execute(SQL)
> %>
>
> What am I doing wrong?
> thanks!
What you are doing wrong is using string delimiters around that numeric
value. Response.Write that SQL variable and verify that the resulting
statement will run in query analyzer before attempting to run it from asp.
The line should be:
SQL = SQL & "Values (" & io_ShippingCost & ")"
> Does anyone have examples of the CONVERT function?
Not needed in this case, but have you looked in Books Online (BOL)? It
should be installed on your pc - look in the SQL Server program group in
your Windows Start menu.
Bob Barrows
-- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
- Next message: Bob Barrows: "Re: Posting a value for a field in select option"
- Previous message: Stuart Palmer: "Re: Beginner Question."
- In reply to: shank: "convert function"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|