Yes you can.
For the purposes of this example:
The table I set up is Tbl_Test
The fields were
IDNum (assuming you are only going to have one A record and one D record for each ID Num)
Transtype (A, D or anything else, text field)
O_Time (starting time)
C_Time (ending time)
this query will do what you want:
Code:
SELECT Tbl_Test.IDNum, Max(IIf([transtype]="A",[O_Time],Null)) AS StartTime, Max(IIf([transtype]="D",[C_Time],Null)) AS EndTime, DateDiff("s",[starttime],[endtime]) AS Expr1
FROM Tbl_Test
GROUP BY Tbl_Test.IDNum;