September 20, 2011 at 11:13 am
i need to do gradntotal , i created UDF(scalar),but i cannot include in select statement coz of where clause it not getting correct total,what is alternative of this
September 20, 2011 at 11:18 am
Why can't you add the grand total once in SSRS or whatever tool you are using to show the data?
September 20, 2011 at 11:18 am
Huh?
Please post table definitions, sample data and desired output. Read this to see the best way to post this to get quick responses.
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 20, 2011 at 11:23 am
i need to do in sp only
September 20, 2011 at 11:24 am
daveriya (9/20/2011)
i need to do in sp only
Why?
September 20, 2011 at 11:25 am
coz its joining multiple views and then it comes as a grandtotal
September 20, 2011 at 11:26 am
daveriya (9/20/2011)
coz its joining multiple views and then it comes as a grandtotal
Why do you have to do the grand total in the SP instead of the front end where I recommend to do it?
September 20, 2011 at 11:34 am
i have to use that grand total in formula and then i need to show result
September 20, 2011 at 11:37 am
Read up on Grouping Sets (or post the information I asked for)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 20, 2011 at 11:43 am
there are so many sum function in my select statement,if i do grouping sets ,it will apply to all funcion,i just want for particular function
September 20, 2011 at 1:18 pm
We can't see what you see. Provide the info Gail asked for if you really want our help. Else wise all you are going to get are wild shots in the dark that won't help or snarky answers.
September 20, 2011 at 1:26 pm
just wondering if this post has any relevance to this one by same OP...???
http://www.sqlservercentral.com/Forums/FindPost1176651.aspx
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
September 20, 2011 at 1:30 pm
I AM GETTING ERROR LIKE Windowed functions cannot be used in the context of another windowed function or aggregate.
WHEN I AM USING THIS
SUM((PMT/ (sum(SUM(ISNULL(PMT,0)))over() ) * VALUE))OVER() as AMOUNT
SO I M USING UDF FOR (sum(SUM(ISNULL(PMT,0)))over() ) VALUE,BUT ITS TAKING LONGER TIME ,I WANT TO REDUCE TIME ,SO I WANT ALTERNATIVE OF UDF
September 20, 2011 at 1:34 pm
Please post table definitions, sample data and desired output. Read this to see the best way to post this to get quick responses.
http://www.sqlservercentral.com/articles/Best+Practices/61537/
And please don't shout at us (post in all caps). We do want to help.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 20, 2011 at 2:39 pm
this function is the only my problem,nothing else
Viewing 15 posts - 1 through 15 (of 20 total)
You must be logged in to reply to this topic. Login to reply