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
|
|
COUNT(DISTINCT...) |
Author |
Message |
|
Posted : 2007-11-08 09:58:25 |
Hi,
I get a "expected lexical element not found: <identifier>
When I run:
SELECT count(distinct InvoiceLine.RefNumber) FROM InvoiceLine InvoiceLine unoptimized WHERE (InvoiceLine.TxnDate>={d '2007-06-24'}) AND (InvoiceLine.TxnDate<={d '2007-06-30'})
When I run:
SELECT count(InvoiceLine.RefNumber) FROM InvoiceLine InvoiceLine unoptimized WHERE (InvoiceLine.TxnDate>={d '2007-06-24'}) AND (InvoiceLine.TxnDate<={d '2007-06-30'})
and
SELECT DISTINCT InvoiceLine.RefNumber FROM InvoiceLine InvoiceLine unoptimized WHERE (InvoiceLine.TxnDate>={d '2007-06-24'}) AND (InvoiceLine.TxnDate<={d '2007-06-30'})
They work fine, I am using msquery, direct SQL |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-11-09 08:46:50 |
The use of count(distinct ...) is not supported within QODBC. In this case:
SELECT count(distinct InvoiceLine.RefNumber) FROM InvoiceLine InvoiceLine unoptimized WHERE (InvoiceLine.TxnDate>={d '2007-06-24'}) AND (InvoiceLine.TxnDate<={d '2007-06-30'})
you should simply use:
SELECT count(Invoice.RefNumber) as "Count" FROM Invoice Invoice unoptimized WHERE (Invoice.TxnDate>={d '2007-06-24'}) AND (Invoice.TxnDate<={d '2007-06-30'})
instead. |
|
|
|
|