Results 1 to 4 of 4

Thread: INSERT problem

  1. #1
    Join Date
    Jun 2002
    Posts
    3

    Unanswered: INSERT problem

    Hello,

    I am i am trying to INSERT from one table to another table using a string:
    ssql = "INSERT INTO tbl_RS([Year],[JulianDate], [Batch], [StartingSequence], [EndingSequence],[BatchTotal],[CRD],[Dept],[Type],[LoadDate],[Comments],[CSRInitials], [StartDate],[CompleteDate],[RegisteredMail]) " _
    & "SELECT tbl_History.Year,tbl_History.JulianDate, tbl_History.Batch,tbl_History.StartingSequence,tbl _History.EndingSequence,tbl_History.DCNRange,tbl_H istory.BatchTotal,tbl_History.CRD,tbl_History.Dept ,tbl_History.Type,tbl_History.LoadDate,tbl_History .Comments,tbl_History.CSRInitials,tbl_History.Star tDate,tbl_History.CompleteDate,tbl_History.Registe redMail " _
    & "FROM tbl_History " _
    & "WHERE (((tbl_History.CSRInitials) = '" & SEARCH_on & "'));"

    when i do CurrentDb.Execute (sSQL) it tells me The Microsoft Jet engine cannot find input table or query . The table tbl_RS IS there, so whats the problem? Please let me know.

    Thanks!

  2. #2
    Join Date
    Nov 2001
    Posts
    336
    Space is missing after tbl_RS:

    You wrote:
    ssql = "INSERT INTO tbl_RS([Year],[JulianDate], ..."

    Change it to:
    ssql = "INSERT INTO tbl_RS ([Year],[JulianDate], ..."

    HTH, Igor

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    actually, your columns do not match up properly

    you have tbl_History.DCNRange as an extra column in the SELECT

    rudy
    http://rudy.ca/

  4. #4
    Join Date
    Jun 2002
    Posts
    3
    thanks guys i kinda solved it yesterday, thanks anyways!

Posting Permissions

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