Hey Bob, How about a CREATE TEMP TABLE and then load the records you want to consider into it. Then do your queries.
Scott ==== Bob Castanaro wrote: > Hello all, > > I have a table that collects historical data for surgical procedures by > doctor, procedure and date (also collects times, and other info etc.) I > use this data for estimating stimes for scheduling purposes. What I need > to do is limit the info to the most recent 20 or 30 procedures for any > particular doctor and delete the rest. Some have less than 20 procedures, > some have hundreds. This table has about 25,000 rows, and I really don't > need data for how long it took Dr. X to take out a Gall Bladder 3 years ago > when his most recent times are more relevant. > I've looked at a routine using cursors to scroll through and "group by" but > I always seem to get stuck somewhere. > Any ideas? > Thanks in advance. > BC > > ================================================ > TO SEE MESSAGE POSTING GUIDELINES: > Send a plain text email to [EMAIL PROTECTED] > In the message body, put just two words: INTRO rbase-l > ================================================ > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] > In the message body, put just two words: UNSUBSCRIBE rbase-l -- Scott ==== Scott J. Salisbury Matrix Data Systems / The R:Street Journal 5114 Point Fosdick Drive NW, Suite E-272 Gig Harbor, WA 98335-1733 [EMAIL PROTECTED] [EMAIL PROTECTED] www.MatrixDataSystems.Com www.SeaNet.Com/~sjs Direct Line: 206-423-7679 Toll Free: 888-386-5040 Seattle: 206-448-7975 Tacoma: 253-444-5166 Fax: 305-425-0491 ================================================ TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: INTRO rbase-l ================================================ TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: UNSUBSCRIBE rbase-l
