September 13, 2005 at 8:28 pm
Are trying to create reporting tool out of single query?
Answer on your last question depends on:
where you going supply results to;
what kind of presentaton format you gonna use;
etc...
But actually SQL Server suppose to supply data, there are other applications for creating presentations.
_____________
Code for TallyGenerator
September 13, 2005 at 8:51 pm
I know how to do it in vb.net but was wondering if a querry might save some time.. When i ran across the Grouping with rollup... that is what opened this can of worms up.. FOR the rollup up i will be using that in a datagrid,, but was looking into other option for a divider inside a drop downlist... ddl
erik.
Dam again!
September 13, 2005 at 9:43 pm
"... but was looking into other option for a divider inside a drop downlist"
Another method to skin that cat it to use union queries.
DECLARE @tbl table ( grp varchar(4), field int )INSERT INTO @tbl VALUES ('ABC', 1) INSERT INTO @tbl VALUES ('ABC', 2) INSERT INTO @tbl VALUES ('DEF', 3) INSERT INTO @tbl VALUES ('DEF', 4) INSERT INTO @tbl VALUES ('GHI', 5) INSERT INTO @tbl VALUES ('GHI', 6)SELECT 1 as [ord], grp, CAST(SUM(field) as varchar(6)) as GrpCnt FROM @tbl GROUP BY grp UNION SELECT 2, grp, '----' FROM @tbl GROUP BY grp UNION SELECT 3, '', CAST(SUM(field) as varchar(6)) FROM @tbl UNION SELECT 4, '', '====' ORDER BY grp DESC, [ord]
--------------------
Colt 45 - the original point and click interface
September 13, 2005 at 9:50 pm
i see your guy on the left banging his head... thats what mine feels like..
thank you very much! for the code!
erik...
Dam again!
September 13, 2005 at 9:53 pm
September 13, 2005 at 9:56 pm
Looks like your copy and paste didn't work. There should be a line break or space in between @tbl and GROUP
--------------------
Colt 45 - the original point and click interface
September 13, 2005 at 10:05 pm
Just copyed and pasted into a word doc. then pasted into analyer.. works great..
really nifty looking. I will spend some time with it,, to try to learn more about the way that you have implemeted this. I need to get a better understanding of unions..
thanks,
erik
Dam again!
Viewing 7 posts - 16 through 21 (of 21 total)
You must be logged in to reply to this topic. Login to reply