Using Access Database
Table
Cardno name cardeventdate Intime Outtime
0001 Michael 20080811 102746 185249
0001 Michael 20080812 080828 080828
0002 Michael 20080811 082615 082615
0002 Michael 20080812 073624 190605
From the Above Table I want to Display another Two Column like
Cardno, name, cardeventdate, Intime, Outtime, Yesterday cardeventdate (Previous column date), Yesterday Outtime (Previous column Outtime)
For Cardno – 0001
Name – Michael
Date – 20080811
Intime – 102746
Outtime – 185249
Yesterday Date – 102746
Yesterday Outtime – 185249
For Example, Today Intime is 090000 and Outtime is 180000 I want to display Today Date, Intime, Outtime, Previous Date Column, Previous Outtime Column belong to Cardno
My Date is not continuously, in my database date is like 20090601, 20090508. So we cannot put date-1
Am Using Sub Queries
Expected Output
Cardno name cardeventdate Intime Outtime Yesterdaycardeventdate YesterdayOuttime
0001 Michael 20080811 102746 185249 20080810 175050
0001 Michael 20080812 080828 080828 20080811 185249
0002 Michael 20080811 082615 082615 20080810 192727
0002 Michael 20080812 073624 190605 20080811 082615
Need Query Help?