Topic: Please, Help with a few questions :)
Hello.
First of all, i'm very very very sorry to bother everyone in the forum.
I probably should say this but i am not a programmer, at least not before i started using my visual database, i started learning a little bit about delphi and sql, but i am still newbie , and i don't have a professional method to do what i want.
Saying this, i am stuck in a part of my project.
Here's what i need to know:
- How do i retrieve all id's from a tablegrid?
i know sqlvalue gives me the id for the selected row, but how do i retrieve all the id's from one tablegrid?
- How do i count multiple quantities with SQL?
i know that i can use SQLExecute('SELECT COUNT(Quant) FROM stock WHERE upper(Quant)=upper("'+id+'"); (Where ID var is the SQLValue
But this only gives me one count, can i use something like Where upper(quant)=upper(1,3,7,14 etc...?); And if i can do this, how can i then count the individual quantities to check if they are below 0?
- How do i update multiple quantities into SQL?
After counting the avaiable stock, i will want to update the values with the new quantities, if so, can i use commas to seperate the diferent id's ?
something like: SqlExecute('Update Stock Set Quant ' 1,2,3,5 Where Id = 1,3,7,14); and if i do this will id 1 have 1 quantity, id 3 have 2 quant, id 7 have 3 and id 14 have 5 ? or will this not work?
After knowing all this, all i need to know, is how can i use this new info to update the stock when someone accepts an invoice.
That's all i need to finaly finish my project!
Please help me, and i'll be eternatly grateful!