Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Calculations

Author  Topic 

GavinD1977
Yak Posting Veteran

83 Posts

Posted - 2007-05-18 : 03:07:33
Hello all. I am trying to do a calculation within an SQL script, however it doesnt seem to be working and i'm a little bit lost. If anyone could shed some light on where i'm going wring it would be much appreciated. The code I have is:




select
EMPLOYEE.EMPLOY_REF AS EDIT_REF,
SV_EMPLOYEE_CURRENT_HOLIDAY.ENTITLEMENT,
SV_EMPLOYEE_CURRENT_HOLIDAY.CARRIED_FWD,
SV_EMPLOYEE_CURRENT_HOLIDAY.TAKEN,
SV_EMPLOYEE_CURRENT_HOLIDAY.REMAINING,
SV_EMPLOYEE_CURRENT_HOLIDAY.SOLD,
SV_EMPLOYEE_CURRENT_HOLIDAY.PURCHASED,
SV_EMPLOYEE_CURRENT_HOLIDAY.ENTITLEMENT + SV_EMPLOYEE_CURRENT_HOLIDAY.SOLD - SV_EMPLOYEE_CURRENT_HOLIDAY.PURCHASED AS TOTAL_ENTITLEMENT
from
EMPLOYEE
left outer join
SV_EMPLOYEE_CURRENT_HOLIDAY
on
EMPLOYEE.EMPLOY_REF = SV_EMPLOYEE_CURRENT_HOLIDAY.EMPLOY_REF
where
EMPLOYEE.EMPLOY_REF = = 027



Incidentaly SV_EMPLOYEE_CURRENT_HOLIDAY is a view which currently exists.

Thanks in advance people.

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-05-18 : 03:09:28
What is the error you are getting? Also post view definition.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

GavinD1977
Yak Posting Veteran

83 Posts

Posted - 2007-05-18 : 03:21:50
Hi mate.

lol.......ok, my apologies. It was while reading through your response I realised my mistake was in the caluclation format. I had it the wrong way round

Ive tried it again and it works fine now. Thanks for takingthe time to reply though. Much appreciated.
Go to Top of Page
   

- Advertisement -