pa********@hotmail.com (PaulMac) wrote in
news:1e**************************@posting.google.c om:
delete top 3 * from mytable...doesn't work (I'm using an .adp if
that makes any difference)...i definitely tried this approach
the problem with the query approach is the number of records i
want to delete is a variable that is populated from within code...
First off, TOP 3 is going to be randomly selected unless you include
a non-ambiguous ORDER BY clause (i.e., one that can produce only one
definitive sort order for any group of records).
If you have a variable N for TOP N, you have to do one of two
things:
1. construct the SQL in code and execute it in code.
OR
2. in code, save a stored querydef with the appropriate N value and
execute that.
I see absolutely no reason to do #2 and would also do #1.
--
David W. Fenton
http://www.bway.net/~dfenton
dfenton at bway dot net
http://www.bway.net/~dfassoc