|
Subject:
|
CONVERT
|
|
Posted By:
|
Adam H-W
|
Post Date:
|
9/22/2004 10:12:47 AM
|
Hi there
I'm trying to use the convert function to convert a column of type money to a string but this is the error I get in QA:
Line 2: Incorrect syntax near 'd'.
this is the code I'm using:
SELECT r.Price FROM DVDRegions r, DVDCustomers d WHERE r.Total = CONVERT(money, d.Price)d.Price
any help would be greatly apprectiated.
Adam
|
|
Reply By:
|
bmains
|
Reply Date:
|
9/22/2004 11:39:04 AM
|
Hey,
Change CONVERT(money, d.Price)d.Price to CONVERT(money, d.Price)
Also, you could try using an inner join too:
select r.Price from DVDRegions r inner join DVDCustomers d on r.Total = convert(money, d.Price)
Brian
|
|
Reply By:
|
Adam H-W
|
Reply Date:
|
9/23/2004 3:43:03 AM
|
thanks Brian but I get this error when I try and do this:
Implicit conversion from data type varchar to money is not allowed. Use the CONVERT function to run this query.
any ideas.
Adam
|
|
Reply By:
|
bmains
|
Reply Date:
|
9/23/2004 7:24:52 AM
|
Hey,
What is the data type for r.Total?
Brian
|
|
Reply By:
|
Adam H-W
|
Reply Date:
|
9/24/2004 1:40:37 AM
|
No worries, you've just jogged my memory! thanks Brian
got it now.
|
|
Reply By:
|
Imar
|
Reply Date:
|
9/24/2004 10:53:05 AM
|
What a nice way to make a living, converting varchars to Money..... ;-)
Imar --------------------------------------- Imar Spaanjaars Everyone is unique, except for me. While typing this post, I was listening to: Biscuit by Portishead (Track 9 from the album: Dummy) What's This?
|