Hi, new to the forum today and am hoping someone can shed some light on a problem I'm having with the 'minimum' and 'maximum' functions.
I have a database of >20 million records, containing serial numbers of products, in batches of 50,000 in each batch. Sets of these serial numbers are allocated to users (user is a numeric field) and when they are allocated a datetime field records that allocation date/time.
I'm trying to report the start and end serial numbers allocated to a user on each day (there could be multiple allocations to multiple uses on any given day) so I'm grouping the allocation date field by 'second'.
I need to show the min and max serial numbers allocated to a user on a given day and using minimum({serial_no},{allocation_date}) and maximum({serial_no},{allocation_date}) for this. So far so good -
My problem is, if in a batch of 50,000 serial number records the first 5000 are allocated to user 1 and the next 4000 to user 2, followed by the next 3000 to user 1 again (all on the same day) the report shows that user 2 has 4000 (correctly) but user 1 is shown as having 12,000, i.e. the report is ignoring the allocation to user 2 in the middle.
Hopefully I've explained my query clearly - if anyone can offer me some clues as to how I can show these allocations correctly I'd be very grateful
Thanks
PeterH