Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query Question
Message
 
To
29/04/2009 16:19:13
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01397059
Message ID:
01397065
Views:
61
>Any way to do this in a query?
>
I can't figure out how to do it with a single SQL Query

This works but oh so NOT elegant:
SELECT *,0000 as grouper FROM tickets INTO CURSOR c_tickets order by ticket READWRITE
LOCAL lnGrouper
lnGrouper=1
SELECT c_tickets
SCATTER MEMVAR
SCAN ALL
	IF status<>m.status or booknumber<>m.booknumber
		lnGrouper=lnGrouper+1
	ENDIF
	replace grouper WITH lnGrouper IN c_tickets
	SCATTER MEMVAR
ENDSCAN

select booknumber,status, min(ticket),max(ticket) ;
	from c_tickets ;
	group by booknumber,grouper
Brandon Harker
Sebae Data Solutions
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform