I'm working on a project at the moment, and what I'm trying to do seems like it should be so simple, but I just can't think of how to do it.
I need to pull somewhat of a distribution of records based on date and one other criteria.
For the date differences, I'm just planning on (for now) pulling a few different date ranges, and labeling them according to the date range.
Within that, I want to pull some sort of distribution from across each date range. So, for instance, if I've got 5,000 records that have dates between 1/1/2011 and 1/10/2011, I want to pull 1,000 of those, but I want to try to get as even a distribution as possible amongst the other criteria. The other criteria is a text field (actually, I can query on the ID of said text field, and pull that in later).
So, here is what I'd like the data to look like once the query is run:
[TT]RecordID Fruit Date
11111 Apple 1/1/2011
11112 Pear 1/2/2011
11113 Orange 1/1/2011
11114 Grape 1/10/2011
22222 Apple 2/5/2011
22221 Pear 2/12/2011
22223 Orange 2/7/2011
22224 Grape 2/3/2011[/TT]
I hope that's enough fake data to get the idea across. I'm not concerned with ordering the results for the purpose, I just need to get a distribution across the text category within each date range.
Let me know whether or not I'm making any sense.
Thanks.
I need to pull somewhat of a distribution of records based on date and one other criteria.
For the date differences, I'm just planning on (for now) pulling a few different date ranges, and labeling them according to the date range.
Within that, I want to pull some sort of distribution from across each date range. So, for instance, if I've got 5,000 records that have dates between 1/1/2011 and 1/10/2011, I want to pull 1,000 of those, but I want to try to get as even a distribution as possible amongst the other criteria. The other criteria is a text field (actually, I can query on the ID of said text field, and pull that in later).
So, here is what I'd like the data to look like once the query is run:
[TT]RecordID Fruit Date
11111 Apple 1/1/2011
11112 Pear 1/2/2011
11113 Orange 1/1/2011
11114 Grape 1/10/2011
22222 Apple 2/5/2011
22221 Pear 2/12/2011
22223 Orange 2/7/2011
22224 Grape 2/3/2011[/TT]
I hope that's enough fake data to get the idea across. I'm not concerned with ordering the results for the purpose, I just need to get a distribution across the text category within each date range.
Let me know whether or not I'm making any sense.
Thanks.