Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use returned data inside procedure
Message
De
22/09/2015 10:53:04
 
 
À
22/09/2015 10:49:42
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2014
Application:
Web
Divers
Thread ID:
01624886
Message ID:
01624922
Vues:
33
>OK, I modified the procedure one more time.

>See attached image for the result set. Now, I generated one result set, with a column for the ResultSetNum (1 means summarized by day, 2 means summarized by week, 3 means grand totals). You can use this, and in the application layer you can strip out the necessary rows to build the 2nd grid (or just filter the second grid where the resultsetnum is not equal to 1)

>here's the code. I simply did a 2nd UNION ALL that summarized by the Saturday Date (by using the pretty common date logic of >adding X number of days, where X is 7-the day of week of the date). As Naomi stated, you could use GROUPING SETS as well. >There are multiple ways to do it.

>Here's the modified procedure. If you truly need multiple result sets, I'd have to modify this and can't do it right now, so someone >else can take a crack if they want to - I wouldn't be able to get to it until tonight.

Nothing else needed, thank you very much Kevin, this is it for me. Have a great day.
John Harold Belalcázar Lozano
Associate Director Of Development
http://www.belvicto.co/
jhbelalc@gmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform