SQL Update CheckingAccount ?

Page 1 of 1
5 posts
SQL Update CheckingAccount ?

winkface
New MMEX User

Posts: 6
Joined: Tue Jan 03, 2017 3:38 pm
These don't work, and I don't know why........ This is day Five on this.......

-------------------------------- A ---------------------------------------------------------------
UPDATE   CHECKINGACCOUNT_V1
SET   PAYEEID=30,
  CATEGID=35,
  SUBCATEGID=74
WHERE  ACCOUNTID=2
  And PAYEEID=335
  And CATEGID=125 
   And TRANSAMOUNT=(995 or 987);

-------------------------------- B ---------------------------------------------------------------

UPDATE   CHECKINGACCOUNT_V1
SET   PAYEEID=30,
  CATEGID=35,
  SUBCATEGID=74
WHERE  ACCOUNTID=2
  And PAYEEID=335
  And CATEGID=125
  And (TRANSAMOUNT=995 or TRANSAMOUNT=997);

Please Help???????????????????
Re: SQL Update CheckingAccount ?

Nikolay
MMEX Developer

Posts: 1163
Joined: Sat Dec 06, 2008 8:27 am
Location: Sankt-Petersburg, Russia
This is incorrect
 And TRANSAMOUNT=(995 or 987);
should be 
 And TRANSAMOUNT in (995,987);
Re: SQL Update CheckingAccount ?

winkface
New MMEX User

Posts: 6
Joined: Tue Jan 03, 2017 3:38 pm
UPDATE   CHECKINGACCOUNT_V1SET   PAYEEID=30,
  CATEGID=35,
  SUBCATEGID=74WHERE  ACCOUNTID=2
  And PAYEEID=335
  And CATEGID=125
  And TRANSAMOUNT in (995,987);

Produces on test --->  SQL Syntax error
This is the error I've been getting all along.
Using --->  General Report Manager
Maybe that's the problem, trying to update using a report manager??????????
Re: SQL Update CheckingAccount ?

winkface
New MMEX User

Posts: 6
Joined: Tue Jan 03, 2017 3:38 pm
That's the answer, don't use report manager to update...

I user --  SQLiteSpy_1.9.11  -- and the changes took right away.

Thanks for the code correction, I would still be trying to get this to work without that.
Re: SQL Update CheckingAccount ?

Nikolay
MMEX Developer

Posts: 1163
Joined: Sat Dec 06, 2008 8:27 am
Location: Sankt-Petersburg, Russia
FYI
General Report Manager is working only for select ( read only mode).
Any apdates and inserts have been forbiden to avoid DB damage.
Page 1 of 1
Who is online

Users browsing this forum: No registered users and 2 guests