Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QUERY SYNTAX

Status
Not open for further replies.

cabernet

Technical User
Feb 24, 2003
75
PK
Hello,
Here is my quest
within a table I have:
sectionID field
adate field
and others fields ....

sectionID field has 10 sections numbered from 1 to 10
and date field obviously one per day or many per each day

I wish to write a query as follow:
to select for example a section with an ID of 4 within sectionID and from for example 02/10/2003 to 02/15/2003
then when selected next step is delete

I have tried this but syntax is not correct and does not include a delete command
SELECT sectionID FROM articles WHERE adate BETWEEN 01/20/2003 and 01/22/2003 and sectionID between 3 and 5;

I will appreciate any help in writing that query and the delete command


thank you

Regards
 
SELECT sectionID
FROM articles
WHERE adate BETWEEN '2003-01-20' AND '2003-01-22'
AND sectionID BETWEEN 3 AND 5


Between is inclusive of the endpoints.

The delete would be

delete
FROM articles
WHERE adate BETWEEN '2003-01-20' AND '2003-01-22'
AND sectionID BETWEEN 3 AND 5
 
Thank you very much I see where I was wrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top