select query

R

realspido

I have a table CREXPORT:

GH_1_1 DE_1 DE_2 DE_3
58001 27/6/06 7:00 In
58001 27/6/06 16:55 Out
58001 28/6/06 7:01 In
58001 28/6/06 16:59 Out
58002 27/6/06 7:04 In
58002 27/6/06 17:02 Out

How to make a query to get tblInOut:

NO DATE IN OUT
58001 27/6/06 7:00 16:55
58001 28/6/06 7:01 16:59
.....


PLEASE HELP!!!!!
 
S

Svetlana

SELECT DISTINCTROW CREXPORT.GH_1_1, CREXPORT.DE_1, First(CREXPORT.DE_2)
AS [IN], Last(CREXPORT.DE_2) AS OUT
FROM CREXPORT
GROUP BY CREXPORT.GH_1_1, CREXPORT.DE_1;
 
M

Marshall Barton

realspido said:
I have a table CREXPORT:

GH_1_1 DE_1 DE_2 DE_3
58001 27/6/06 7:00 In
58001 27/6/06 16:55 Out
58001 28/6/06 7:01 In
58001 28/6/06 16:59 Out
58002 27/6/06 7:04 In
58002 27/6/06 17:02 Out

How to make a query to get tblInOut:

NO DATE IN OUT
58001 27/6/06 7:00 16:55
58001 28/6/06 7:01 16:59


Insufficient data :)

You need some way to determine which Out goes with which In.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top