Click here to Skip to main content
15,896,726 members

Comments by Misha india (Top 11 by date)

Misha india 17-Sep-13 3:58am View    
employee_detail

id name designationid customizedtime
1 Misha 1 0
2 Tina 2 1


designation_timing
designationid workinghr
1 9


Employee_timing
empid workinghr
2 8
Misha india 17-Sep-13 3:19am View    
select empname,case when dt.workinghr >9 then 'present' else 'Absent' end as day1
from employee_detail ed left join designation_timing dt on dt.designationid=ed.designationid and customizedtime=0

this is done for designation wise timing now if customizedtime=1 then i want to join
with employee_timing table
Any body can help me??

Misha india 17-Sep-13 3:11am View    
empname day1
Misha present
Tina Absent

this present absent will depend on working hr from either designation_timing & employee timing
Misha india 17-Sep-13 0:17am View    
this is not relative answer because i want to get output from table field by checking condition in when in above answer they had used procedure but i want to check particular field..
Here is my table detail,


i had 3 tables employee_master ,employee_timing & designation_timing.
now, there is one field in employee master i.e customizedtime.
I want to calculate the time of employee on the bases of employee_timing & designation_timing but there is one condition while joining this table if employee_master's field customizedtime is true then i have to join with table employee_timing other wise with designation_timing
Misha india 13-Aug-13 1:43am View    
i want to take backup of that database i had tried trusted connection also but its not working.