Results 1 to 4 of 4
  1. #1
    steenesse is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    11

    Syntax error when using Except

    I have never used the EXCEPT clause in FROM and when I try I get syntax error. Can anybody tell me what's wrong with the following code:

    CsSQL = "SELECT FileName FROM tblFTPFileList EXCEPT SELECT FileName FROM Imports;"
    Set fname = CurrentDb.OpenRecordset(CsSQL)

    Both SELECT Queries word by them selves, but why I try to combine them with EXCEPT, I get syntax error. I have tried brackets, but nothing works.





  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Did you find some documentation that indicated MSAccess SQL uses/is compatible with the EXCEPT statement?
    I have not seen nor found any such statement. I have seen T-SQL /SQL Server reference.
    Perhaps you could tell us what you are trying to accomplish and readers will offer some options.

  3. #3
    steenesse is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    11
    Doh ! I see you're right. I'll find another way. Thanks

    I was trying to create automatic FTP download and import of files that haven't been downloaded , keeping a list in a separate table of what's imported.

  4. #4
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    I'm pretty sure you could use the Not In syntax, something like

    Code:
    CsSQL = "SELECT FileName FROM tblFTPFileList Where Filename Not IN( SELECT FileName FROM Imports);"
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 01-04-2016, 09:40 AM
  2. Replies: 11
    Last Post: 05-01-2014, 11:56 AM
  3. Replies: 3
    Last Post: 01-23-2014, 07:49 AM
  4. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  5. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums