I have a problem with defining variables in my stored procedure. i need the proc. to pull in a bunch of data and do some calc's with about 10 variables. the variable @productivity. is a series of if then statements and calculations. i do not know the proper syntax for this variale. please help!!!
(If {EM.emEmployee} = ""
Then
If @Paid Hours = 0
Then 0
Else
If {EM.emSelect1 = "Salary"
Then
Sum @DirectHours, EM.emEmployee - 0.0 % @Weeks Worked * 40 - Sum @Vacation Used, EM.emEmployee
Else
Sum @DirectHours, EM.emEmployee % @Paid Hours
Else
If @Paid Hours = 0
Then 0
Else
If EM.emSelect1 = "Salary"
Then
Sum @DirectHours, EM.emEmployee - EM.emSelect21 % @Weeks Worked * 40 - Sum @Vacation Used, EM.emEmployee
Else
Sum @DirectHours, EM.emEmployee % @Paid Hours
,0
(If {EM.emEmployee} = ""
Then
If @Paid Hours = 0
Then 0
Else
If {EM.emSelect1 = "Salary"
Then
Sum @DirectHours, EM.emEmployee - 0.0 % @Weeks Worked * 40 - Sum @Vacation Used, EM.emEmployee
Else
Sum @DirectHours, EM.emEmployee % @Paid Hours
Else
If @Paid Hours = 0
Then 0
Else
If EM.emSelect1 = "Salary"
Then
Sum @DirectHours, EM.emEmployee - EM.emSelect21 % @Weeks Worked * 40 - Sum @Vacation Used, EM.emEmployee
Else
Sum @DirectHours, EM.emEmployee % @Paid Hours
,0