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
|
|
How to SELECT unique entries |
Author |
Message |
|
Posted : 2006-06-14 18:35:41 |
As I test out the abilities of your driver with a Visual Basic app I'm playing with I'm having trouble locating the proper way to make a selection of only unique entries.
I'm curently using: sSQL = "SELECT TxnDate,RefNumber,CustomerRefFullName FROM Invoice WHERE Txndate>={d '2006-02-01'} AND Txndate<={d '2006-02-28'}"
I'd like it to only select dates that are unique, eliminating any duplicate entries.
I'm also looking for some reference/documentation that would explain proper SELECT statement syntax. I stumbled across the {d 'date'} and still don't know entirely what the {d portion does. I'm guessing date but in VB select statements I've just been able to use a 'string' and be done with it.
Thanks for your help, Sterg |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2006-06-14 21:14:20 |
If you're looking for a unique date line for each customer invoiced during a date range, then the statement is:
SELECT DISTINCT TxnDate, CustomerRefFullName FROM Invoice WHERE Txndate>={d '2001-02-01'} AND Txndate<={d '2008-02-28'}
RefNumber is usually a unique Invoice number for each invoice, that's why I left if out.
See How are dates formatted in SQL queries when using the QuickBooks generated time stamps? for more on dates.
As far as SQL syntax is concerned there are many books and even online sites that teach how to use SQL. |
|
|
|
|