Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update query - problems using convert function

Status
Not open for further replies.

pmsbony

IS-IT--Management
Joined
May 17, 2001
Messages
36
Location
GB
I am trying to set a bunch of fees in a table to 0 and got an error converting varchar to smallmoney. I was advised to use the convert function to sort it out, but the documentation I have is not really clear on how to use the convert syntax in the middle of an update query the original SQL query was:

update search
set src_actual_fee = '0'
where src_created between '01-Jun-2001' and '30-jun-2001'

I was unsure where the convert would fit into the query to allow me to update the column
 

If the column is smallmoney, remove the quotes around the zero.

update search
set src_actual_fee = 0
where src_created between '01-Jun-2001'
and '30-jun-2001'

The Convert function syntax would look like this.

Convert(smallmoney, varcharcol) Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top