Viewing 8 posts - 16 through 23 (of 23 total)
Try somthing like this...
SELECT TENANCYID=Max(TENANCYID),
SUPPLIERID,
EMPLOYEEID,
InvAmount,
openingBalance = (SELECT Sum(openingBalance) FROM mytablename WHERE itemtype=12 GROUP BY itemtype) ,
payment= (SELECT sum(openingbalance) FROM mytablename WHERE itemtype<>12 GROUP BY itemtype)
FROM mytablename
GROUP BY...
March 16, 2005 at 2:25 pm
Thanks for advice. I'm new at this and need all the help I can get.
March 3, 2005 at 9:34 am
I really appreciate your help!
Here is a stripped down version (and below that is the entire stored procedure)
SELECT L.[CFT Location]
, DateMonth=CAST(LEFT(DATENAME(m,DS.DenialDate),3)AS varchar) + '-' + CAST((DATEPART(yy,DS.DenialDate)) AS varchar)
, DS.DenialDate
, DR.RemitCode
,...
March 2, 2005 at 4:06 pm
The second statement works but I need to had a HAVING (or WHERE) clause so that it can relate back to the main statement.
This works alone:
SELECT SUM(A.DeniedCharge)
FROM ( SELECT DISTINCT Account, DenialDate,...
March 2, 2005 at 3:09 pm
Thanks Remi. My challenge is that I need to get the DenialCharge only once for each Account,DenialDate,Location,DenialCode group (so just the values $296.51, $1,400.00, and $200.00) and then sum them...
March 2, 2005 at 12:37 pm
Thanks. Almost there. In the main statement I group by DenialDate, Location and DenialCode. How do I alter the nested SUM statement so that it will group on the same fields? Here...
March 2, 2005 at 12:02 pm
I'm new at this and wasn't aware of print (string) but doing this I found my problem!
It was really stooopid. I had limited the @strSQL variable to 800 so it...
February 23, 2005 at 2:14 pm
Viewing 8 posts - 16 through 23 (of 23 total)