Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
If you can't
login and post questions or you are having trouble viewing forum posts:
Click Here
|
Callback
Support |
If you live in USA, UK, Canada, Australia or New
Zealand, you can leave us details on your question and request us to call you back and discuss
them with you personally (charges apply). |
Click Here
|
Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
|
ReceivePayment Query Hangs |
Author |
Message |
Tom |
|
Group | : Members |
Posts | : 5 |
Joined | : 2008-01-11 |
|
Profile |
|
Posted : 2008-02-10 03:46:47 |
I'm trying to run a simple query against the ReceivePayment table and it appears to hang (or at least take longer to run than my patients will sit and wait for :-). The query that I'm running is:
"SELECT TxnDate as Date, Memo, TotalAmount as Amount ,UnusedPayment as OpenBalance FROM ReceivePayment where CustomerRefListID='" + custID + "' ORDER BY TxnDate DESC"
Do you have any ideas as to what may be causing this query to hang?
Thanks,
Tom Andreu |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-02-10 22:26:13 |
At first clance I would say the query is doing a table scan because of the order by TxnDate, the SQL should be:
"SELECT TxnDate as Date, Memo, TotalAmount as Amount ,UnusedPayment as OpenBalance FROM ReceivePayment where CustomerRefListID='" + custID + "' ORDER BY CustomerRefListID, TxnDate DESC"
If your optimized table is up-to-date, you can also try:
"SELECT TxnDate as Date, Memo, TotalAmount as Amount ,UnusedPayment as OpenBalance FROM ReceivePayment NOSYNC where CustomerRefListID='" + custID + "' ORDER BY CustomerRefListID, TxnDate DESC"
for faster results.
See: How do I setup the QODBC Optimizer? Where are the Optimizer options? for more info. |
|
|
|
Tom |
|
Group | : Members |
Posts | : 5 |
Joined | : 2008-01-11 |
|
Profile |
|
Posted : 2008-02-17 01:08:46 |
Thank you for the information. I'll give this a try.. |
|
|
|
|