Results 1 to 3 of 3
  1. #1
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    365

    Error in Insert Query

    CurrentDb.Execute ("INSERT INTO hList SELECT vLIst.* FROM vList WHERE vList.MyNum > = 288;")

    I wanted all fields in vList from 288 would go into hList (which is a blank table of the same structure as vList)



    But I'm getting Syntax error (missing operator) in query expression. What might be wrong please?

  2. #2
    Join Date
    Apr 2017
    Posts
    1,679
    Probably because you used alias to point at field, but you did'nt define this alias!
    Try
    "INSERT INTO hList SELECT * FROM vList Whe MyNum >= 288;"
    Or to be on safe side
    "INSERT INTO hList SELECT vlist.* FROM vList vlist Whe vlist.MyNum >= 288;"

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    IIRC, you're not supposed to enclose the sql statement or variable.
    CurrentDb.Execute "INSERT INTO hList SELECT vLIst.* FROM vList WHERE vList.MyNum > = 288;"
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Insert Query causing Error 2766
    By carmenv323 in forum Macros
    Replies: 7
    Last Post: 12-02-2021, 05:46 PM
  2. Replies: 4
    Last Post: 03-26-2019, 02:40 PM
  3. Error with INSERT INTO query
    By mdavid in forum Forms
    Replies: 2
    Last Post: 11-17-2017, 06:38 AM
  4. Replies: 14
    Last Post: 07-07-2015, 07:39 PM
  5. Replies: 3
    Last Post: 03-05-2013, 11:17 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