Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why this doesn't work?
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01118369
Message ID:
01118394
Views:
10
Ok, making var private fixed the problem.

Here is what I have:
SELECT COUNT(Trans.cTrans_pk) as iAccounts_Count, ;
IIF(not IsNull(Trans_Employees_Queues.cCommission_Owner_UsGrLink_fk), ;
Trans_Employees_Queues.cCommission_Owner_Usgrlink_fk, ;
Trans_Employees_Queues.cUsGrLink_fk) as cUsGrlink_pk, ;
SUM(Trans.yCurrent_balance_amount)  as yBalance ;
FROM TRANS
INNER JOIN Trans_employees_queues   ;
ON Trans.cTrans_pk = Trans_employees_queues.cTrans_fk ;
INNER JOIN Employee_queue_schedules ;
ON Trans_employees_queues.cTrans_employees_queues_pk = ;
Employee_queue_schedules.cTrans_employees_queues_fk ;
WHERE Trans.cResolution_Codes_fk is Null ;
AND Employee_queue_schedules.tScheduled_time <= {^2006-05-02 23:59:59} ;
AND Trans_employees_queues.iActive_Flag = 1  ;
AND Employee_queue_schedules.iActive_Flag = 1  ;
AND ;
IIF(not IsNull(Trans_Employees_Queues.cCommission_Owner_UsGrLink_fk), .T., ;
(Trans_employees_queues.iTemporary_Assignment_Flag = 1    AND ;
Trans_employees_queues.tStart_Date <= {^2006-05-02 23:59:59}   AND ;
Trans_employees_queues.tExpire_Date >= {^2006-05-02 23:59:59}))
GROUP BY 2
Using index tag Crescod_fk to rushmore optimize table trans
Rushmore optimization level for table trans: full
Rushmore optimization level for table trans_employees_queues: none
Using index tag Tschedtime to rushmore optimize table employee_queue_schedules
Rushmore optimization level for table employee_queue_schedules: partial
Joining table trans and table trans_employees_queues using index tag Ctrans_fk
Joining intermediate result and table employee_queue_schedules using index tag Cempque_fk

BTW, when I removed GROUP BY, I got the same time (69 sec.)
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform