dawes4000
asked on
How to convert varchar to money on sql insert
I need to convert varchar to money data type when doing a SQL insert. I'm using sql server 2000. Below is my insert statement.
INSERT INTO mast
(custno, sodate, ordate, disc, taxrate, tax, ordamt, authamt, ponum, salesmn, sostat, sono, defloc, finalized, adddatetime) VALUES ('#qrymast.custno#','#qrym ast.sodate #','#qryma st.ordate# ','#qrymas t.disc#',' 0','0','#q rymast.ord amt#','0', '#qrymast. ponum#','# qrymast.sa lesmn#','# arguments. status#',' #qrymast.s ono#','#de floc#','#f inalized#' ,'#qrymast .adddateti me#')
The Insert fails on taxrate, tax, ordamt. I have tried the CONVERT function but have not been able to get it to work, and have left my attempts out of this post only to keep it brief.
INSERT INTO mast
(custno, sodate, ordate, disc, taxrate, tax, ordamt, authamt, ponum, salesmn, sostat, sono, defloc, finalized, adddatetime) VALUES ('#qrymast.custno#','#qrym
The Insert fails on taxrate, tax, ordamt. I have tried the CONVERT function but have not been able to get it to work, and have left my attempts out of this post only to keep it brief.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@dawes4000
If you were using cfqueryparam you wouldn't have to worry about this kind of problem ;-)
If you were using cfqueryparam you wouldn't have to worry about this kind of problem ;-)
... I think I submitted that last comment via "SUBMIT" and not "OBJECT". But in case I didn't, to any mods: No, I don't have any objection :)
select @y =123900.00
select @x = convert( varchar(100), @y)