Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Cannot Call methods on Float - error

Author  Topic 

pvong
Yak Posting Veteran

58 Posts

Posted - 2013-11-21 : 15:32:34
I basically want to update one table from another table on a different DB on another server.

T1 - Ticker, Px (Want to Update PX from T2.PX where T1.Ticker = T2.Ticker)
T2 - Ticker, PX

NOTE - Both PX in both tables have type FLOAT

Here is my update statement:

UPDATE T1
SET Px = T1.Px.Moxy
FROM MutualFundsReflowDetails AS T1 INNER JOIN
(SELECT Symbol AS Ticker, Price AS Px
FROM SRV5MOXY.Moxy60.dbo.MoxyPrice AS MoxyPrice_1
WHERE (SecType = 'csus')) AS T2 ON T1.Ticker = T1.Ticker


When I try to run this update, I'm getting the Cannot call methods on float error message. I've Googled this but not really finding a solution.



Please help a newbie!!

------------------------------
Using VS2010 / Learning in VB.Net / Win2008 R2 / SQL 2008 R2
Be kind to the newbies because you were once there.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2013-11-21 : 15:47:11
Have you tried running it in Management Studio instead? I think the issue is with Visual Studio.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

pvong
Yak Posting Veteran

58 Posts

Posted - 2013-11-21 : 16:18:08
I have and it's still the same error message as you can see below.



------------------------------
Using VS2010 / Learning in VB.Net / Win2008 R2 / SQL 2008 R2
Be kind to the newbies because you were once there.
Go to Top of Page

pvong
Yak Posting Veteran

58 Posts

Posted - 2013-11-21 : 16:32:58
Maybe I'm just writing my whole Update statement wrong but I'm not sure where it's wrong.

------------------------------
Using VS2010 / Learning in VB.Net / Win2008 R2 / SQL 2008 R2
Be kind to the newbies because you were once there.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2013-11-21 : 17:41:14
I think you have some typos:

UPDATE T1
SET Px = T2.Px
FROM MutualFundsReflowDetails AS T1 INNER JOIN
(SELECT Symbol AS Ticker, Price AS Px
FROM SRV5MOXY.Moxy60.dbo.MoxyPrice AS MoxyPrice_1
WHERE (SecType = 'csus')) AS T2 ON T1.Ticker = T2.Ticker


Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

pvong
Yak Posting Veteran

58 Posts

Posted - 2013-11-21 : 19:32:26
Thanks so much!!! This worked perfectly!!!

------------------------------
Using VS2010 / Learning in VB.Net / Win2008 R2 / SQL 2008 R2
Be kind to the newbies because you were once there.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2013-11-22 : 20:39:03
Glad it worked, wasn't sure. You're welcome!

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -