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

  • Home
  • SEARCH
  • 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 8704597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:08:50+00:00 2026-06-13T03:08:50+00:00

My question is identical to the one in How can SQL create duplicate records?

  • 0

My question is identical to the one in How can SQL create duplicate records?. However, I’m trying to do it in Access, and none of the solutions there appear to be applicable. Preferably, I’d like a single SQL statement.

Thanks.

  • 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-06-13T03:08:53+00:00Added an answer on June 13, 2026 at 3:08 am

    The accepted answer from that linked question can be adapted for Access. Create your num table from the user interface. If you want to create the table with a DDL statement, use this.

    Dim strDdl As String
    strDdl = "CREATE TABLE num (" & vbCrLf & _
        "i INTEGER PRIMARY KEY" & vbCrLf & _
        ");"
    Debug.Print strDdl
    CurrentProject.Connection.Execute strDdl
    

    Load the num table. In Access, a VBA procedure would be convenient.

    Public Sub Load_Num_table()
        Dim db As DAO.Database
        Dim rs As DAO.Recordset
        Dim x As Long
    
        Set db = CurrentDb
        Set rs = db.OpenRecordset("num", dbOpenTable, dbAppendOnly)
        For x = 1 To 100
            rs.AddNew
            rs!i = x
            rs.Update
        Next x
        rs.Close
        Set rs = Nothing
        Set db = Nothing
    End Sub
    

    With your num table prepared and your other table named tableX, use this SQL statement to return a row set with duplicated rows.

    SELECT t.id, t.name
    FROM
        tableX AS t
        INNER JOIN num 
        ON num.i <= t.count;
    

    The only real difference in that SELECT statement vs. the one suggested by @ypercube in the accepted answer to that other question is INNER JOIN instead of just JOIN. Access’ db engine won’t accept JOIN alone; you must specify the join type (inner, left, or right).

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

Sidebar

Related Questions

There is almost identical question , but I have no idea what to do
Short question: is there a way to access the datatypes available in .net application
I have a question that is similar, but not identical, to the one answered
I asked the question this way because I can imagine that there's a potentially
In many flavors of SQL, there are three ways you can implicitly set a
This question is identical to this Two loop bodies or one (result identical) but
The simple question is how can you take a set of records with a
First, I know there is a lot of duplicate answers already, but I can't
I looked through Stackoverflow and found almost identical question here . It was asked
This question is very similar (or almost identical) to In a non blocking socket

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.