Good Afternoon,
I have a database for asset tracking. We are required to do a 10% random inventory each month so that by the end of the 10th month we have inventoried 100% of all assets. After the 10% inventory is completed the date is entered into the table.
I've built a query that will give me the random 10% I'm looking for on the initial run. Each time I run the query I still want it to give me 10% of the TOTAL NUMBER OF RECORDS in the table but only return those that the 10% inventory date is NULL.
My problem is, with the way my code is written it's not pulling from ALL records, only this that don't have a date entered. Here's my code:
SELECT TOP 10 PERCENT [Control Log].*
FROM [Control Log]
WHERE ((([Control Log].[Last 10% Inventory]) IS NULL))
ORDER BY Rnd([ID])
The ID field is the record unique autonumber field that I use as my seed field for the RND function.
Again, all I want the query to do is ALWAYS return 10% of the TOTAL records in the table, not just the records that the 10% date field is empty. Any help is greatly appreciated.
I have a database for asset tracking. We are required to do a 10% random inventory each month so that by the end of the 10th month we have inventoried 100% of all assets. After the 10% inventory is completed the date is entered into the table.
I've built a query that will give me the random 10% I'm looking for on the initial run. Each time I run the query I still want it to give me 10% of the TOTAL NUMBER OF RECORDS in the table but only return those that the 10% inventory date is NULL.
My problem is, with the way my code is written it's not pulling from ALL records, only this that don't have a date entered. Here's my code:
SELECT TOP 10 PERCENT [Control Log].*
FROM [Control Log]
WHERE ((([Control Log].[Last 10% Inventory]) IS NULL))
ORDER BY Rnd([ID])
The ID field is the record unique autonumber field that I use as my seed field for the RND function.
Again, all I want the query to do is ALWAYS return 10% of the TOTAL records in the table, not just the records that the 10% date field is empty. Any help is greatly appreciated.