Bluehost.com Web Hosting $6.95

Help with Update

This is a discussion on Help with Update within the MySQL Database forums, part of the Database Forums category; So, I'm having issues with this update statement. UPDATE a, b SET nh = nh + TRUNCATE((1000 - SQRT(nP) - nT * ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-13-2006
Ryan Knopp
 
Posts: n/a
Default Help with Update

So, I'm having issues with this update statement.

UPDATE a, b
SET nh = nh + TRUNCATE((1000 - SQRT(nP) - nT * 85 - TRUNCATE((f + m) /
2, 0) - 50 * (10 - n)) / 100, 0)
WHERE b.c is TRUE and b.n is NOT 0

Failed: You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '0' at line 1

I can't for the life of me figure out what's wrong. All the parentheses
are closed. The only thing I can think of maybe is my SET statement is
to long. Any Suggestions?

Thanks
Ryan
Reply With Quote
  #2 (permalink)  
Old 12-13-2006
Ryan Knopp
 
Posts: n/a
Default Re: Help with Update

Ryan Knopp wrote:
> So, I'm having issues with this update statement.
>
> UPDATE a, b
> SET nh = nh + TRUNCATE((1000 - SQRT(nP) - nT * 85 - TRUNCATE((f + m) /
> 2, 0) - 50 * (10 - n)) / 100, 0)
> WHERE b.c is TRUE and b.n is NOT 0
>
> Failed: You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near '0' at line 1
>
> I can't for the life of me figure out what's wrong. All the parentheses
> are closed. The only thing I can think of maybe is my SET statement is
> to long. Any Suggestions?
>
> Thanks
> Ryan

Figured it out.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 03:13 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0