Link to home
Start Free TrialLog in
Avatar of mel150
mel150

asked on

use the convert function to run this query

Hi,

 I am a beginner, so be very simplistic with me, ok?

 I am trying to run this query:

update orders
set subtotal='59'
where id=47

And I get this:
disallowed implicit conversion from data type varchar to data type money. use the convert function to run this query.

 how do I do this? thanks!


Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Hi mel150,

if the datatype of the column subtotal is numeric you don't need to use the quotes

try
update orders
set subtotal=59
where id=47

hope this helps a bit
bruintje
ASKER CERTIFIED SOLUTION
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mel150
mel150

ASKER

Thanks very much!! I didn't try the first one, but the second one worked!! Thanks so much!
glad i could help, but i should thank you for pushing me over to the SQL Server master level ;-)
Avatar of mel150

ASKER

Congratulations! Glad I could be of service. :)