Is Not SQL

Results 1 to 2 of 2

Thread: Is Not SQL

  1. #1
    Join Date
    Dec 1969

    Default Is Not SQL

    I am trying to delete records in a table that are IN an array, and NOT = to a variable. <BR>Dim strChosenClients, iContactId<BR>iContactId = Request.form("iContactId")<BR>&#062;&#062;&#062;iC ontactId will be a number like 34234<BR>strChosenClients = request.form("Chosen")<BR>&#062;&#062;&#062;&#062; strChosenClients will be something like 1234,343234,23421,23423<BR>&#062;&#062;&#062;&#062 ;<BR>They are simply "multiple" check boxes<BR>&#039;delete Chosen clients<BR>Dim strSQL3<BR>strSQL3 = "DELETE FROM tblContacts "&_<BR>"WHERE tblContacts.ContactId NOT "& iContactId &" "&_<BR>"AND tblContacts.ContactId IN ("& strChosenClients &") "<BR>objConn.Execute strSQL3<BR><BR>I get a syntax error. DB is MSSQL7. I think maybe the NOT is incorrect?<BR>Thanks in advance.<BR>David<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Is Not SQL

    strSQL3 = "DELETE FROM tblContacts "&_ <BR>"WHERE not tblContacts.ContactId = "& iContactId &" "&_ <BR>"AND tblContacts.ContactId IN ("& strChosenClients &") " <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts