Results 1 to 3 of 3
  1. #1
    Hanss is offline Novice
    Windows 10 Access 2002
    Join Date
    Jul 2021
    Posts
    2

    Query generates results?

    Hi,

    I am wondering if there is anyway to do this with an access query:

    I have table1 with two fields and data:

    Temp: Count:
    15 2


    20 3

    I would like a query that generates the following results:

    Results:
    15
    15
    20
    20
    20

    I would appreciate any direction.

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    You can but the easiest way to achieve this you would need a numbers table.

    SELECT tb_Test1.Temp
    FROM tb_Test1, tb_Numbers
    WHERE (((tb_Numbers.id)<=[recCount]))
    ORDER BY tb_Test1.Temp;

    Numbers Table tb_test1 Result
    ID RecNo Temp RecCount Temp
    1 1 15 2 15
    2 1 20 3 15
    3 1 20
    4 1 20
    5 1 20
    6 1
    7 1
    8 1
    9 1
    10 1
    11 1
    12 1
    13 1
    14 1
    15 1
    16 1
    17 1
    18 1
    19 1
    20 1
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Hanss is offline Novice
    Windows 10 Access 2002
    Join Date
    Jul 2021
    Posts
    2
    Thank you VERY much for this simple method!!!

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

Similar Threads

  1. Multi Select Value(s) Generates Append Query
    By skydivetom in forum Programming
    Replies: 6
    Last Post: 02-01-2019, 03:59 PM
  2. Replies: 2
    Last Post: 04-05-2016, 11:02 AM
  3. Replies: 5
    Last Post: 03-03-2014, 11:07 PM
  4. query that generates percentages
    By jppevy in forum Access
    Replies: 3
    Last Post: 07-30-2013, 10:44 PM
  5. Replies: 1
    Last Post: 10-12-2012, 03:23 PM

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