467,134 Members | 918 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,134 developers. It's quick & easy.

Delete Statement

I need a delete statement to delete records using the below select statement. I got a mind block as to what should be used in the where clause column operator.

Expand|Select|Wrap|Line Numbers
  1. DELETE from InvOnHand
  2. WHERE <unknown column operator>
  3. (SELECT InvOnHand.*
  4. FROM   InvMaster Join InvOnHand On InvMaster.partno = InvOnHand.partno
  5. WHERE  InvMaster.category = 'bag' and DatePart(yyyy, transdate) between 2004 and 2007 and NOT (InvOnHand.partno in (partlist))
Expand|Select|Wrap|Line Numbers
  1. SELECT InvOnHand.*
  2. FROM   InvMaster Join InvOnHand On InvMaster.partno = InvOnHand.partno
  3. WHERE  InvMaster.category = 'bag' and DatePart(yyyy, transdate) between 2004 and 2007 and NOT (InvOnHand.partno in (partlist))
Jan 22 '09 #1
  • viewed: 1574
1 Reply
What through me off was the first optional keyword "from". Got r done.

Expand|Select|Wrap|Line Numbers
  1. DELETE InvOnhand
  2. FROM InvMaster Join InvOnHand On InvMaster.partno = InvOnHand.partno
  3. WHERE  InvMaster.category = 'bag' and DatePart(yyyy, transdate) between 2004 and 2007
  4.       and NOT (InvOnHand.partno in (partlist)
Jan 22 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

14 posts views Thread by php newbie | last post: by
4 posts views Thread by Stefan Strasser | last post: by
16 posts views Thread by robert | last post: by
4 posts views Thread by AlanAylett | last post: by
1 post views Thread by Matt | last post: by
12 posts views Thread by yufufi | last post: by
8 posts views Thread by Michel Esber | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.