Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mark1504
Posting Yak Master
103 Posts |
Posted - 2004-05-27 : 09:10:39
|
| I want to return a SELECT list consisting of various columns including a numeric one (the Invoice total). How do I get the total showing on the bottom line?Thanks in anticipationMark |
|
|
rihardh
Constraint Violating Yak Guru
307 Posts |
Posted - 2004-05-27 : 09:18:30
|
| Why would someone want to do something like that? Make a simple SELECT on the server and save the total line for the client (GUI) side. |
 |
|
|
Pethron
Starting Member
10 Posts |
Posted - 2004-05-27 : 09:23:36
|
| You could do it with a UNION SELECT in with you set the sum([numeric collumn])for the total and NULL for the others.But summize the total on Clientside is cleaner, I think... |
 |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2004-05-27 : 09:23:43
|
| select 1 as sortcol, col1, col2, col3, InvTotalfrom Invoicesunionselect 2 as sortcol, 'Total', 'Total', 'Total', SUM(InvTotal)from Invoicesorder by 1Duane. |
 |
|
|
mark1504
Posting Yak Master
103 Posts |
Posted - 2004-05-27 : 09:47:30
|
| UNION! I haven't used that before. An simple and direct solution. Thanks ditch and Pethron. |
 |
|
|
|
|
|