Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Result without group by
Message
 
To
13/07/2005 00:56:57
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01032051
Message ID:
01032054
Views:
22
Hi Robert,

> I do not want to use command like select sum(pen).

SUM() is probably not a good function, but I can't see why you would rule out MAX(). In SQL there is no concept of the "first record", since it's set based. If MAX(Pen), and so forth, cannot be used, the best solution would be to create a cursor and use a SCAN loop. Skip through the table and copy field values only if the field for this month in the cursor is still empty. Something like:
SELECT Table1
SCAN
  SELECT Cursor
  LOCATE FOR Month=Table1.Month
  IF NOT FOUND()
    INSERT INTO Cursor (Month) VALUES (Table.Month)
  ENDIF
  IF NOT EMPTY(Table.Pen) and EMPTY(Cursor.Pen)
    REPLACE NEXT 1 Pen WITH Table1.Pen
  ENDIF
ENDSCAN
--
Christof
Previous
Reply
Map
View

Click here to load this message in the networking platform