split table and join it again side by side

andi

New member
Local time
Today, 14:45
Joined
Apr 20, 2016
Messages
8
hi guys,
i have a table, the name is CHECKINOUT and the table have fields, otherwise:

1. EID (this is a Employes ID, but this is not a primary key and indx is No)
2. CHECKTIME (this is a TIME and the format is ddmmyyy hh.mm.ss)
3. CHECKTYPE (this is a teks field and in that is I or O; I is In and O is Out

and my questions is
how to made a query from CHECKINOUT Table to be like this?

1. EID
2. CHECKTIMEIN (taken from CHECKTIME and CHECKTYPE with category I
3. CHECK TIMEOUT (taken from CHECKTIME and CHEKTYPE with category O

im sorry my english is bad

and thanks you for the care
 
Code:
SELECT qA.eid, qA.checktime AS checktimein, qB.checktime AS checktimeout
FROM 

(
SELECT eid, checktime
from checkinout
WHERE checktype = "I"
) AS qA

LEFT JOIN

(
SELECT eid, checktime
FROM checkinout
WHERE checktype = "O"
) AS qB

ON qA.eid = qB.eid
 
i have tryed but still failed

can you make the way in this file,


if success please give the file,
and i will learn it
 

Attachments

Users who are viewing this thread

Back
Top Bottom