tinyevil777
Registered User.
- Local time
- Today, 20:46
- Joined
- Dec 10, 2010
- Messages
- 137
Hello.
After a few hours of tearing my hair out, i'm afraid i have to ask for some of your valuable time in helping me...
I have a table with 3 columns; Site, Live, Target. The Live and Target fields are both integers. I have a stored procedure which creates a temporary table and totals the data. Please see below for an example:
What i am TRYING to get is...
What seems like a simple [Live]/[Target]*100 calculation is proving to much for me as i'm having to take into account values of '0'. When i use this simple calculation, it returns a 'cannot divide by zero' error. Very frustrating.
Additionall, for sites 3PT and 5KL, i'm actually not sure what conversion % is mathematically and logically correct... My head is frazzled!
Can someone save me?
Thank you in advance!
Tom.
After a few hours of tearing my hair out, i'm afraid i have to ask for some of your valuable time in helping me...
I have a table with 3 columns; Site, Live, Target. The Live and Target fields are both integers. I have a stored procedure which creates a temporary table and totals the data. Please see below for an example:
Code:
Site Live Target
0LO 2 2
1BL 1 5
2XA 3 4
3PT 0 0
4FH 0 2
5KL 1 0
What i am TRYING to get is...
Code:
Site Live Target Conversion
0LO 2 2 100%
1BL 1 5 20%
2XA 3 4 75%
3PT 0 0 ??%
4FH 0 2 0%
5KL 1 0 ??%
What seems like a simple [Live]/[Target]*100 calculation is proving to much for me as i'm having to take into account values of '0'. When i use this simple calculation, it returns a 'cannot divide by zero' error. Very frustrating.
Additionall, for sites 3PT and 5KL, i'm actually not sure what conversion % is mathematically and logically correct... My head is frazzled!
Can someone save me?
Thank you in advance!
Tom.