OR or AND

D

DS

I need to update an item and if there is an item with the subgroup +1,
update that as well. I'm using this and it sems to be working. Does
this update one or both, what is the logic?

DelMSql = "DELETE * FROM tblCheckDetailsTMP " & _
"WHERE tblCheckDetailsTMP.CDCheckID = Forms!frmFXVoidItem!TxtSalesID " & _
"AND tblCheckDetailsTMP.CDGroupID = Forms!frmFXVoidItem!TxtGroupID " & _
"AND tblCheckDetailsTMP.CDSubGroupID = Forms!frmFXVoidItem!TxtSubGroupID
" & _
"OR tblCheckDetailsTMP.CDCheckID = Forms!frmFXVoidItem!TxtSalesID " & _
"AND tblCheckDetailsTMP.CDGroupID = Forms!frmFXVoidItem!TxtGroupID " & _
"AND tblCheckDetailsTMP.CDSubGroupID =Forms!frmFXVoidItem!TxtSubGroupID +1;"
DoCmd.RunSQL (DelMSql)

Thanks
DS
 
D

Douglas J. Steele

That's a Delete query: it doesn't update, it deletes.

It will delete all rows that meet either of the criteria.
 
D

DS

Douglas said:
That's a Delete query: it doesn't update, it deletes.

It will delete all rows that meet either of the criteria.
Sorry, Douglas. Not paying attention I should have posted the same thin
but as an Update Query. In either case it sounds like that it will do
as I need it.
DS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Select From 1
SQL Not Updating 2
Not Updating 2
SQL SYNTAX ERROR 8
SELECT INSERT 1
SQL ORDER BY 1
UNION Error 9
Is This Right? 3

Top