• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Changing update query in SQL

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically in this image when I enter the account number the balance will be found, that part is okay. Now when it comes to deposit, I want it to take the existing Account balance and update the table with the deposit amount entered. How do I change the update query according to that?

Here's my code for the find button

123.JPG
[Thumbnail for 123.JPG]
 
Rancher
Posts: 4190
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the first thing to do is have the UPDATE statement that works.

Where have you got with that side?
 
Marshal
Posts: 6974
471
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One important thing.

Now imagine person entered Deposit or/and Account balanace and clicked "FIND". What does that supposed to return as a result? Of course nothing, that just doesn't make sense - so why such option exist?

I think apart from the mechanics, you need to improve user interaction part. Probably would make more sense if by entering account number user could be found and you'd get to such account's page where you could either deposit or check balance, meaning you wouldn't have FIND button anymore in that screen. Get an idea what's off here...
 
Aathif Saleem
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:Well, the first thing to do is have the UPDATE statement that works.

Where have you got with that side?



So far I've gotten upto here



The problem is that this simply just updates the AccountBalance column of the table, I want it to add this amount with the deposit amount (that I enter) so the table will be updated with AccountBalance=AccountBalance + Deposit
 
Aathif Saleem
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Liutauras Vilda wrote:One important thing.

Now imagine person entered Deposit or/and Account balanace and clicked "FIND". What does that supposed to return as a result? Of course nothing, that just doesn't make sense - so why such option exist?

I think apart from the mechanics, you need to improve user interaction part. Probably would make more sense if by entering account number user could be found and you'd get to such account's page where you could either deposit or check balance, meaning you wouldn't have FIND button anymore in that screen. Get an idea what's off here...



Yeah I didn't completely think it through, I need to improve the user interaction part. Thought of getting round to all that once I get my functions/methods right.
 
Liutauras Vilda
Marshal
Posts: 6974
471
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The problem is that this simply just updates the AccountBalance column of the table, I want it to add this amount with the deposit amount (that I enter) so the table will be updated with AccountBalance=AccountBalance + Deposit


So you need to tell that. Now you just updating, meaning setting the value you specified.

You'd need to do something towards that:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!