Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Auto assign values to range

$
0
0
Hello All!

Unsure if this is possible but here goes. Have the following QRY and would like to automatically assign a range of values i.e., 1-10 in a separate column to each record within each Batch# and reset after a new Batch# :S

Problem is that within each Batch # there are multiple records assigned as well as multiple Batch #'s.

Any suggestions? Thanks!

Code:

SELECT [Batch Summary].[Batch #], [Batch Summary].[Part Number], [Batch Summary].EL01MV AS Location, [Batch Summary].[# of Pieces], [Batch Summary].[Batch Create Date], [Batch Summary].[Batch Print Date]
FROM [Ontario Move Batches] RIGHT JOIN [Batch Summary] ON [Ontario Move Batches].[Batch #] = [Batch Summary].[Batch #]
WHERE ((([Ontario Move Batches].[Batch #]) Is Null))
GROUP BY [Batch Summary].[Batch #], [Batch Summary].[Part Number], [Batch Summary].EL01MV, [Batch Summary].[# of Pieces], [Batch Summary].[Batch Create Date], [Batch Summary].[Batch Print Date]
ORDER BY [Batch Summary].[Batch #], [Batch Summary].EL01MV;


Viewing all articles
Browse latest Browse all 13329

Trending Articles