Join table

Hi,
i have 2 tables . One of the table records username and ID . another table which records the Time Attendance sheet.the structure is like below.
EmpDetails :
Emp ID    EMP Name   Date of Joining

Attendace Sheet:
EmpID Starttime   EndTime

i need to get a sql join statement to get the output like below in a grid

EMPID EmpName StartTime EndTime

Regards
Sonu
sonukoshyAsked:
Who is Participating?
 
Chandan_GowdaConnect With a Mentor Commented:
please find the attached file
DateTimeStyles.txt
0
 
appariCommented:
try

Select
EMP.EMPID , EMP.EmpName , ATT.StartTime , ATT.EndTime
from EmpDetails EMP join [Attendace Sheet] ATT on
EMP.EmpID = ATT.EmpID
0
 
Chandan_GowdaCommented:
select a.EmpID,a.EMPName,b.Starttime,b.EndTime from EmpDetails  a
            inner join attendence b on a.emid=b.empid
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
sonukoshyAuthor Commented:
That works fine for me.

How can i get the just the time from the Startime Field.

regards
Sonu
0
 
Chandan_GowdaCommented:
select a.EmpID,a.EMPName,convert(varchar,b.Starttime,108) as Starttime,convert(varchar,b.EndTime,108) as Endtime from EmpDetails  a
            inner join attendence b on a.emid=b.empid


0
 
sonukoshyAuthor Commented:
What is this 108?
and how can i get AM & PM which is already in the database
0
All Courses

From novice to tech pro — start learning today.