Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 839149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:25:16+00:00 2026-05-15T05:25:16+00:00

in access i am doing this: insert into accounts_changes (select * from accounts where

  • 0

in access i am doing this:

insert into accounts_changes 
 (select * 
  from accounts 
  where [Agency Code] 
  in (select * from tableimport))

it says that it doesnt like this INSERT statement

update:

sSql = "insert into accounts_changes (select * from Accounts where [Agency Code] in (select [Agency Code] from tableimport))"

i did what mark said and it is still giving me the same error message

syntax error in INSERT INTO statement

when i do this:

ssql = "select [Agency Code] from tableimport"
CurrentDb.Execute ssql

it says CANNOT EXECUTE SELECT QUERY

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:25:16+00:00Added an answer on May 15, 2026 at 5:25 am

    This part may have misled you:

    ssql = "select [AgencyCode] from tableimport"
    CurrentDb.Execute ssql
    

    Execute requires an “action” query (INSERT, DELETE, UPDATE, or SELECT INTO). When you give Execute a plain (row returning) SELECT query, you will always get error #3065, “Cannot execute a select query”. It doesn’t mean there was anything wrong with your SELECT statement. Test your SELECT statement by pasting it into SQL View of a new query.

    You showed two variations of [AgencyCode] … one with and another without a space between Agency and Code. Which is it?

    I think your original INSERT statement had an extra pair of parentheses which aren’t needed. Try it this way:

    insert into accounts_changes
    select * 
    from Accounts
    where [Agency Code] in (
        select [Agency Code] from tableimport)
    

    If that still fails, verify you have the same number of fields, with the same field names and data types in both Accounts and accounts_changes. If the fields in the two tables don’t match exactly, list the fields explicitly as @pcent showed you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use an access card reader with PHP. I am doing this
I want to insert a new row into an Access database. I'm looking at
first time I'm doing an insert from ASP.NET/C# and I'm having a little issue.
I have this query, which was working fine. SELECT SUM(amount) FROM company.invoice_line WHERE item_id
I'm using Access 2003 and doing a make table query. The idea is, I
I'm doing something like zgrep somepattern access_log.X.gz But I find that a lot of
I am doing an asp.net mvc application having a Data Access Layer (DAL). Having
I am doing some research about how to access data in a UniData database
Access denied for user 'root '@'localhost' (using password: YES) Yes, this error is all
PHP - Access MSSQL datetime column from the returned array Array ( [0] =>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.