Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
First and last based on same SQL
Message
De
10/10/2014 09:24:14
 
 
À
10/10/2014 02:33:45
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01609079
Message ID:
01609124
Vues:
38
>From what I sense, you want to have the fist and latest person that approved any invoice for every client? Correct?
>
>I think it can be done very simple:
>
>
>SELECT *,
>   (SELECT TOP 1 ApprovedPersonName FROM Invoices WHERE NoClient = Client.Numero ORDER BY AddDate ) as firstperson,
>   (SELECT TOP 1 ApprovedPersonName FROM Invoices WHERE NoClient = Client.Numero ORDER BY AddDate DESC) as Lastperson,
>   FROM Client
>
I like that one as well.

Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform