Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

employee attendance Query using 3 tables left innerjoins

$
0
0

I Have 3 tables

dbo.Emp_setting

 name   data type allownulls
Empset_id       	int	Unchecked
personal_id	int	Unchecked
DesignationID	int	Checked
DivisionID	        int	Checked
Emp_status	char(1)	Checked
Emp_TypeId	int	Checked
Dept_Id	         int	Checked
Group_Id	        int	Checked
NDIVGRP_CODE	  bigint	Checked


dbo.tempDeviceLogs

 name     datatype   allow nulls
LogsID	           int	    Unchecked
Device_Person_id   int	    Unchecked
Device_id	            int	    Unchecked
logDateTime	datetime	Unchecked
logVerifyMode	nchar(10)	Unchecked
workCodeID	        int	        Unchecked
Machin_install_id	int	Unchecked
data_loaded_dt	   datetime	Checked
Inout	                   int	        Checked
		Unchecked

dbo.persons_profile

[pesonal_id]
      ,[Emp_Code]
      ,[Title]
      ,[First_name]
      ,[Middle_name]
      ,[last_name]
      ,[Father_Husband_Name]
      ,[Dob]
      ,[Age]
      ,[gender]
      ,[Marital_status]
      ,[Nationality]
      ,[bloodGroup]
      ,[perAddress]
      ,[PerStreet]
      ,[PerLocation]
      ,[PerCity]
      ,[PerPincode]
      ,[CorAddress]
      ,[CorStreet]
      ,[CorLocation]
      ,[CorCity]
      ,[CorPincode]
      ,[LandlinePhone]
      ,[cellNo]
      ,[EmailId]
      ,[NosofDependendants]
      ,[Dependendants_details]
      ,[Emergency_FirstName]
      ,[Emergency_Middle_name]
      ,[Emergency_Last_name]
      ,[Emergency_WithRelation]
      ,[Emergency_PhoneNo]
      ,[Emergency_CellNo]
      ,[Emergency_emailId]
      ,[Office_PF_ac_no]
      ,[ESI_ac_no]
      ,[JoinedDate]
      ,[Photofile]
      ,[ReportTo]
      ,[Brief_Notes]
      ,[dateofTermination]
      ,[termination_note]
      ,[Print_Priority]
      ,[DeviceEmployeeID]
      ,[LogsPermitted]
      ,[Machin_install_id]
      ,[Designation]
      ,[Dept]
      ,[Section]
      ,[Groups]
      ,[EmpWorkingTypeT]

required output is

employeename device_person_id designation emptype Date status
STATUS is emp_status whether he is present or absent for a specific day




Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>