[AccessD] Create Multiple records in report

Stuart McLachlan stuart at lexacorp.com.pg
Mon Dec 10 20:46:00 CST 2012


My standard solution for this is a numbers table.  (There are lots of uses for one).

It just contains  single field "Num" and is  populated with a range of numbers from 1 to 1000 
or whatever is appropriate.


Then your query would be 

Select * from tblOrderItems, tblNumbers where tblNumbers.Num <= tblOrderItems.Qty"

IIf tblOrderItems contains
OrderId   Item    Qty
1             1            3
1             2            2

Your recordset would return

OrderID  Item  Qty   Num
1              1       3        1
1              1       3        2
1              1       3        3
1              2       2        1
1              2       2        2

-- 
Stuart

On 11 Dec 2012 at 14:54, David Emerson wrote:

> This is not a direct Access question but more a SQL problem.
> 
>  
> 
> I have a table that has order addresses and number of items ordered.  I want
> to create a label for each item shipped.  If I have an order for 3 widgets
> then I want 3 labels.  Is there a simple way of creating a record set with
> the number of records equalling the number of items shipped (and not the
> number of orders)?
> 
>  
> 
> Regards
> 
> David Emerson
> Dalyn Software Ltd
> Wellington, New Zealand
> 
>  
> 
>  
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list