SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Layout view issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

midpenntech
Posting Yak Master

137 Posts

Posted - 05/14/2008 :  11:19:56  Show Profile  Reply with Quote
I have a report that i have totaled and working correctly and I am able to get the 2 columns to sum up but I need to get those 2 sumed columns to be divided to get the gross prof %.

The columns that I have summed are
=Sum(Fields!eqpsldamt.Value)
=Sum(Fields!grosspro.Value)

I need to take those summed values and divide them but I do not know the propper syntax to do this. I thought it would have been
=SUM(Fields!grosspro.Value) / SUM(eqpsldamt.Value)

But this did not work any help would be great thanks!

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 05/14/2008 :  11:22:51  Show Profile  Reply with Quote
Use:-
=IIF(Sum(Fields!eqpsldamt.Value)>0,Sum(Fields!grosspro.Value)/Sum(Fields!eqpsldamt.Value),0)
Go to Top of Page

midpenntech
Posting Yak Master

137 Posts

Posted - 05/14/2008 :  12:18:41  Show Profile  Reply with Quote
Sorry about the double post but I tried the =IF(Sum(Fields!eqpsldamt.Value)>0,Sum(Fields!grosspro.Value)/Sum(Fields!eqpsldamt.Value),0)

this did not work
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 05/14/2008 :  12:23:43  Show Profile  Reply with Quote
quote:
Originally posted by midpenntech

Sorry about the double post but I tried the =IFIIF(Sum(Fields!eqpsldamt.Value)>0,Sum(Fields!grosspro.Value)/Sum(Fields!eqpsldamt.Value),0)

this did not work


This is not what i posted. See above. its IIF not IF
Go to Top of Page

midpenntech
Posting Yak Master

137 Posts

Posted - 05/14/2008 :  12:24:59  Show Profile  Reply with Quote
i tried both and it didnt work i thought that was a miss type.
Go to Top of Page

midpenntech
Posting Yak Master

137 Posts

Posted - 05/14/2008 :  12:27:52  Show Profile  Reply with Quote
Never mind that actually worked and its posting correctly now i just need to take that result and get it to show in a %

Edited by - midpenntech on 05/14/2008 12:30:33
Go to Top of Page

midpenntech
Posting Yak Master

137 Posts

Posted - 05/14/2008 :  12:34:26  Show Profile  Reply with Quote
any idea how to get it to show up from .083432 to show 8.34%
Go to Top of Page

midpenntech
Posting Yak Master

137 Posts

Posted - 05/14/2008 :  12:39:30  Show Profile  Reply with Quote
I got it you need to go under format and place .###% and it will format it to display 8.34%
Go to Top of Page

midpenntech
Posting Yak Master

137 Posts

Posted - 05/14/2008 :  12:53:51  Show Profile  Reply with Quote
just for personal info what would i need to do to get it to show the value for each line. We did the SUM but how would I do it for each line.

=Fields!eqpsldamt.Value
=Fields!grosspro.Value
Would it be =IIF((Fields!eqpsldamt.Value)>0,(Fields!grosspro.Value)/(Fields!eqpsldamt.Value),0)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 05/14/2008 :  12:59:24  Show Profile  Reply with Quote
quote:
Originally posted by midpenntech

just for personal info what would i need to do to get it to show the value for each line. We did the SUM but how would I do it for each line.

=Fields!eqpsldamt.Value
=Fields!grosspro.Value
Would it be =IIF((Fields!eqpsldamt.Value)>0,(Fields!grosspro.Value)/(Fields!eqpsldamt.Value),0)


Each line ? didnt get that. Please explain your scenario with some data.
Go to Top of Page

midpenntech
Posting Yak Master

137 Posts

Posted - 05/14/2008 :  13:04:56  Show Profile  Reply with Quote
Well we first did the SUM expression that you gave me and it works wonderfull. I wanted to see if we can do each field now. see i was doing =SUM(Fields!grosspro.value and =SUM(Fields!eqpsldamt.Value). Now I just want to use just the fields instead of the SUM.

=Fields!grosspro.value
=Fields!eqpsldamt.Value

just like before but with out the SUM of the columns.
EQPSLDAMT Grosspro Gross%(This is the column i would like)
238499.00, 43234.00
583444.03, 62134.00
234518.54, 95783.34


Edited by - midpenntech on 05/14/2008 13:13:58
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 05/14/2008 :  13:41:42  Show Profile  Reply with Quote
Yup. that you can do by this

=IIF(Fields!eqpsldamt.Value>0,Fields!grosspro.Value/Fields!eqpsldamt.Value,0)
Go to Top of Page

midpenntech
Posting Yak Master

137 Posts

Posted - 05/14/2008 :  13:59:00  Show Profile  Reply with Quote
Thanks for all the help I am sure ill have many more. You have helped out a great deal!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 05/14/2008 :  14:06:14  Show Profile  Reply with Quote
quote:
Originally posted by midpenntech

Thanks for all the help I am sure ill have many more. You have helped out a great deal!


No problem. You are always welcome
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000