|
-
Dec 5th, 2000, 05:32 AM
#1
Thread Starter
Lively Member
Hi,
I have a problem which I hope someone will help me solve. I have a database where user places orders on ariticles. If the article already exists I want the quantity to be updated +1 or if it is a package +4. How do you find out if the article already exists in the recordset? And how do you update this article. Heres my insert into statement
INSERT INTO tbh (Quantity, Article, Description) SELECT (Quantity, Article, Description) FROM ubh
Now if the article that will be inserted already exists I want to be able to update it instead of creating a new line with the same article.
thanks in advance
//Patrick
-
Dec 5th, 2000, 07:42 AM
#2
Lively Member
You need to do a SELECT for the item first.
Then check to see if the recordset is empty ( rs.BOF and rs.EOF)
If its empty then use your insert statement, otherwise add the quantity to the quantity returned by your SELECT statement and update the recordset. ( rs.Update )
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|