Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Impossible query
Message
From
24/02/2003 23:06:44
 
 
To
19/02/2003 07:27:44
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00752198
Message ID:
00757391
Views:
8
Dear Cetin,

It's working ! Ive adapted your code, and also the last code you sent me to make cursors read-write.Thanks very much.I'm very grateful to you !
Sorry for the delay. My work keeps me constantly on the move, so there are som inevitable gaps in my programming.

I am enclosing the code for you to read:

Sele gcode as gangId, gname as pname from gang into cursor crstemp
use dbf("crstemp") in 0 again alias gang1
Use In "Crstemp"
Sele cgang as gangId,ddate as workdate ,nmen from dailywork into cursor crstemp
use dbf("crstemp") in 0 again alias workhrs
Use In "Crstemp"
Sele gcode as gangId,ddate as wagedate,nmen from gang into cursor crstemp
use dbf("crstemp") in 0 again alias wagehistory
Use In "Crstemp"

Select gang1
Index On gangid Tag gangId

Select Workhrs
Index On workdate tag workdate
Index On gangId Tag gangId
Index On gangId+Dtoc(workdate,1) tag workmain

Select wagehistory
Index On gangId tag gangId
Index On wagedate tag workdate desc
Index On gangId+DtoC(wagedate,1) tag wkmnIndex
Index On gangId+DtoC(wagedate,1) Tag wagemain Descending
*set order to gangId, wagedate && This is a new line by me the third line below

*wait wind
SELECT * from gang1
SELECT * from wagehistory ORDER BY gangId, wagedate
SELECT * from Workhrs ORDER BY gangId, workdate

*With 2 SQLs approach :
Select wk.gangId, wk.workdate, Max(wg.wagedate) As wagedate ;
FROM Workhrs wk ;
INNER Join wagehistory wg On wk.gangId = wg.gangId ;
where (wg.wagedate <= wk.workdate) ;
GROUP By wk.gangId, wk.workdate ;
INTO Cursor crsPass1 ;
nofilter

Select pr.gangId, pr.pname, ;
wg.wagedate, wg.nmen, ;
wk.workdate, wk.nmen, wk.nmen * wg.nmen As Calced ;
FROM gang1 pr ;
INNER Join crsPass1 p1 On p1.gangId = pr.gangId ;
INNER Join Workhrs wk On wk.gangId = pr.gangId ;
AND wk.workdate = p1.workdate ;
INNER Join wagehistory wg On pr.gangId = wg.gangId ;
AND p1.wagedate = wg.wagedate ;
ORDER By pr.gangId, wk.workdate ;
INTO Cursor crsPays ;
nofilter
browse


Just one last thing, Cetin. Could you tell me how to prevent browse windows opening when commands like "select * from wagehistory order by gangID" etc are executed ?

Regards,

Steve.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform