Sounds like a job for a stored proc....I don't think a simple query will do it for you.
Get a good T-SQL book! Good luck. -- Josh Trefethen .:::::[ Exciteworks, Inc ]::[ http://exciteworks.com ]:::::. .::[ cf hosting on linux ]::[ consulting ]::[ expertise ]::. -----Original Message----- From: Jeff Beer [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 02, 2003 2:22 AM To: CF-Talk Subject: FW: 2nd try: SQL query help Anyone have any ideas? -----Original Message----- From: Jeff Beer [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 11:00 AM To: CF-Talk Subject: OT: SQL query help Using SQL Server, how would I define a query to return ranges of ID's (primary key) where a tinyint field was not true? I'm looking for any ranges (eg; 12202 - 12249 and 14477 - 15225) where that tinyint field is 0. I'd like to specify a minimum number of records in that range, but it's not absolutely necessary. Something like: show me sequential ranges where myTinyint = 0 and total records in each range > 100 Any help is greatly appreciated! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4