I am having troubles with writing a query in Microsoft Access. This is how my tables looks like and where I want to retrieve data from:
I want a query that has the following result:
As you can see in the first table a user according to CHECKTYPE can check IN 'I' and check OUT 'O' so I was trying to use subqueries and Datediff() to get the difference but I am kind new to subqueries concept and by that I can't get the result I want.



You can use a self-join (to get the Checkout time for any Checkin row); with a subquery (to remove multiple checkout rows, if the same user checks in/out multiple times).
This one assumes that you only have one day's worth of data in the table, and it prints multiple rows for each session (of checkin/checkout):
The addition to 1900-01-01 is done to turn the minutes found into a datetime value, so that I could use the format function to show in the format you want.