all groups > sql server programming > july 2006 >
You're in the

sql server programming

group:

help on delete statement



RE: help on delete statement Sha Anand
7/20/2006 9:34:01 PM
sql server programming: Something like this..

DELETE FROM products
WHERE InvoiceNo IN (SELECT InvoiceNo FROM Invoice WHERE InvoiceDate =
'YourDate')
DELETE FROM Invoice WHERE InvoiceDate = 'YourDate'

- Sha Anand

[quoted text, click to view]
help on delete statement S.G.
7/20/2006 11:29:14 PM
Hi,

I'm using SQL 2000.

I have 2 tables, Invoice and Products.
In 'Invoice' table, there are 2 cols: Invoice/invoicedate
In Products table, there are 2 cols: Invoice/Productid

At the front end 'Access", these two tables are linked using 'invoice'
field. But on SQL backend side, I didn't have any relationship between two
tables.
Now I like to delete some records based on the invoicedate. How can I delete
records from both table if the invoice is the same.

I hope I explain the question properly, if not, please feel free to ask me.

Thanks in advance,
Sarah

Re: help on delete statement Sarah
7/21/2006 10:55:18 AM
Hi Sha, Thanks so much.Sarah
[quoted text, click to view]

AddThis Social Bookmark Button