From: Victoria on
hi
I think this is a beginner's question, but I'm missing something. Lets say
I have a table:

empID(pk) Max_ACount
123 5
136 2
154 3

How can I generate this Query?

empID ACount
123 1
123 2
123 3
123 4
123 5
136 1
136 2
154 1
154 2
154 3

For any given empID, ACount runs from 1 to Max_ACount

thank you in advance
Victoria
From: vanderghast on
Easier if you have a driver table at your disposal:

Have a table, iotas, one field, iota, the primary key, with values from 1
to, say 1000 (can be filled from an Excel column where you will generate
that sequence).

Make a new query.
Bring iotas and the original table.
In the grid, bring empID and iota.
Under iota, add the criteria : <= [yourTableNameHere].[Max_ACount]


That's about it.


Vanderghast, Access MVP



"Victoria" <Victoria(a)discussions.microsoft.com> wrote in message
news:9BF7BFB2-D69B-480D-AFB4-E9519000F8E9(a)microsoft.com...
> hi
> I think this is a beginner's question, but I'm missing something. Lets
> say
> I have a table:
>
> empID(pk) Max_ACount
> 123 5
> 136 2
> 154 3
>
> How can I generate this Query?
>
> empID ACount
> 123 1
> 123 2
> 123 3
> 123 4
> 123 5
> 136 1
> 136 2
> 154 1
> 154 2
> 154 3
>
> For any given empID, ACount runs from 1 to Max_ACount
>
> thank you in advance
> Victoria

From: Victoria on
Perfect! after I sorted empID and iota ASC, this did the job.
Thank you - Victoria


"vanderghast" wrote:

> Easier if you have a driver table at your disposal:
>
> Have a table, iotas, one field, iota, the primary key, with values from 1
> to, say 1000 (can be filled from an Excel column where you will generate
> that sequence).
>
> Make a new query.
> Bring iotas and the original table.
> In the grid, bring empID and iota.
> Under iota, add the criteria : <= [yourTableNameHere].[Max_ACount]
>
>
> That's about it.
>
>
> Vanderghast, Access MVP
>
>
>
> "Victoria" <Victoria(a)discussions.microsoft.com> wrote in message
> news:9BF7BFB2-D69B-480D-AFB4-E9519000F8E9(a)microsoft.com...
> > hi
> > I think this is a beginner's question, but I'm missing something. Lets
> > say
> > I have a table:
> >
> > empID(pk) Max_ACount
> > 123 5
> > 136 2
> > 154 3
> >
> > How can I generate this Query?
> >
> > empID ACount
> > 123 1
> > 123 2
> > 123 3
> > 123 4
> > 123 5
> > 136 1
> > 136 2
> > 154 1
> > 154 2
> > 154 3
> >
> > For any given empID, ACount runs from 1 to Max_ACount
> >
> > thank you in advance
> > Victoria
>
 | 
Pages: 1
Prev: Update query question
Next: First 10 numbers