Results 1 to 2 of 2
  1. #1
    Cheshire101 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Posts
    42

    Question Insert Into Statement with Line Numbers


    Thank you in advance for any help given.....I need to add the line numbers to a table, I have a SQL statement to insert the information into the table from another table.
    Code:
    StrSQL = "INSERT INTO tblTempEmail (Temp#,Email,Assessor,Shift,AreaAssessed,StopDate) SELECT" & _
        " Count(tbltbl2BAssessed.AssessedBY),tblEmployees.Email,tbl2BAssessed.AssessedBy,tbl2BAssessed.Shift,tbl2BAssessed.AreaAssessed," & _
        "tbl2BAssessed.StopDate FROM tbl2BAssessed INNER JOIN tblEmployees ON (tbl2BAssessed.WorkShift" & _
        "= tblEmployees.Shift) AND (tbl2BAssessed.Site = tblEmployees.Area) AND (tbl2BAssessed.AssessedBy " & _
        "= tblEmployees.Title) WHERE (((tbl2BAssessed.StopDate)<Date()) AND ((tbl2BAssessed.AssessNumber) " & _
        "Is Null) AND ((tbl2BAssessed.ByPassDate) Is Null));"
    Everything works if I remove the Temp# field under INSERT and Count function under the SELECTportion. Anyone know how to add the line/row number to the table using SQL???

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664

    Topic: NumberedQuery.mdb (beginner)

    There is an A2K example on Roger Carlson's site at

    http://www.rogersaccesslibrary.com/forum/topic309.html

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

Similar Threads

  1. INSERT query: insert new data only
    By drh in forum Access
    Replies: 2
    Last Post: 04-04-2014, 05:31 PM
  2. Replies: 4
    Last Post: 09-03-2010, 02:55 PM
  3. Syntax Error In Insert Into Statement
    By frankvfox in forum Queries
    Replies: 1
    Last Post: 09-09-2008, 12:35 PM
  4. Insert Dash between set of Numbers
    By Jhankish in forum Programming
    Replies: 2
    Last Post: 04-19-2007, 08:02 AM
  5. Replies: 3
    Last Post: 03-24-2006, 08:40 AM

Tags for this Thread

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