Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple SQL Select issue
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Simple SQL Select issue
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01499700
Message ID:
01499700
Vues:
112
I think it must be Friday... as my mind has gone to lunch this afternoon. I know its only Thursday :)

I have a table with multiple records for employees and dates...
ie epkey 15, might have 4 records on date 1, 3 on date 2, etc...

I don't want to count the records, I want to count the dates...
ie if i just looking at date range between date 1 and 2, I don't want a count of the records, rather a count of the unique dates, ie 2 not 7.

A simple Select like this doesn't work.

Sele epkey, count(date) from histwkrd where date between date1 and date2 group by epkey

would return based on the above data, 7 where I would only to see the distinct dates ie, count those, not all the records.

I know I can do this with two queries, but is there a better way?

TIA,
Mike
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform