Hi.
I'd like to know if after the records have been ticked , whether one can
then have those same records unticked - in case a mistake had been made the
first time to tick them.
----------------------
[color=blue]
>Assuming your table has a numeric primary key named "ID", you can get 170
>random records in the date range with this kind of thing:[/color]
SELECT TOP 170 * FROM [tbl_data entry]
WHERE [Enquiry Date] Between #1/31/2004# And #2/29/2004#
ORDER BY Rnd([ID]), ID;
[color=blue]
>You can then turn it into an Update query (Update on query menu) to update
>the Free field to True.[/color]
[color=blue]
>Notes:
>1. Issue a Randomize in the Immediate Window Ctrl+G) before running the[/color]
query.
[color=blue]
>2. The Rnd() function does not do anything with the ID field, but if you do
>not pass in a changing number, the optimizer does not call the Rnd()
>function on every row.[/color]
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Manton" <sky5@optusnet. com.au> wrote in message
news:40424a92$0 $3956$afc38c87@ news.optusnet.c om.au...[color=blue]
> Access 2000.
> I have a field in a table (tbl_data entry) which has a field called Free[/color]
and[color=blue]
> another field called SD (containing 2 options: 5 and 6)
> The Free field is a yes/no format.
> I'd like to run a query which upon entering a date range ("Enquiry Date")
> value -allows the query to choose 170 records (by ticking off the yes/no
> field "Free") randomly from tbl_data entry.
> Alternatively: It could choose (ticking off the yes/no field "Free) the
> first 170 records within the date range entered (choosing the earliest[/color]
date[color=blue]
> and working down the list).
> thanks.[/color]
I'd like to know if after the records have been ticked , whether one can
then have those same records unticked - in case a mistake had been made the
first time to tick them.
----------------------
[color=blue]
>Assuming your table has a numeric primary key named "ID", you can get 170
>random records in the date range with this kind of thing:[/color]
SELECT TOP 170 * FROM [tbl_data entry]
WHERE [Enquiry Date] Between #1/31/2004# And #2/29/2004#
ORDER BY Rnd([ID]), ID;
[color=blue]
>You can then turn it into an Update query (Update on query menu) to update
>the Free field to True.[/color]
[color=blue]
>Notes:
>1. Issue a Randomize in the Immediate Window Ctrl+G) before running the[/color]
query.
[color=blue]
>2. The Rnd() function does not do anything with the ID field, but if you do
>not pass in a changing number, the optimizer does not call the Rnd()
>function on every row.[/color]
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Manton" <sky5@optusnet. com.au> wrote in message
news:40424a92$0 $3956$afc38c87@ news.optusnet.c om.au...[color=blue]
> Access 2000.
> I have a field in a table (tbl_data entry) which has a field called Free[/color]
and[color=blue]
> another field called SD (containing 2 options: 5 and 6)
> The Free field is a yes/no format.
> I'd like to run a query which upon entering a date range ("Enquiry Date")
> value -allows the query to choose 170 records (by ticking off the yes/no
> field "Free") randomly from tbl_data entry.
> Alternatively: It could choose (ticking off the yes/no field "Free) the
> first 170 records within the date range entered (choosing the earliest[/color]
date[color=blue]
> and working down the list).
> thanks.[/color]
Comment