Hey guys,
Here is what I'm looking for.
for example, I have 5 cameras (labeled c1 - c5) and I have 5 users (u1 - u5), I'm trying to build a system where, I can record a checkout date when U1 takes C1 and then record when he checks it in. Thats all fine and simple to do, the part I'm having a hard time visualizing is lets say I have the following.
cam user checkout checkin
C1 U1 1/1/01 1/5/02
C2 U2 2/2/02 2/5/02
C3 U3 3/8/03 1/5/04
C1 U3 3/8/03
C2 U1 4/5/04
Now on my main page, I want to be able to display what is the 'latest' status of all cams, so in theory it should look like:
cam user checkout checkin
C1 U3 3/8/03
C2 U1 4/5/04
C3 U3 3/8/03 1/5/04
I figured, I cannot use a datagrid because it'll just pull out all the data from the table, as where here, I only want the information of the latest status of each cam.
Further more, if I click on any cam under the colum cam, i'd like to have a history of all information on each cam.
What would I need to display only the latest information?
Right now I have 3 tables. I have a user table, a camera table, and a checkout table that has user and camera as foreign keys. I thought, i might have to have a seperate query for each camera, so select * from cam where cam = c1 sort date asc, and figure it would just take the top data.
However, that seems wrong to me. Any help would be appreciated.
Here is what I'm looking for.
for example, I have 5 cameras (labeled c1 - c5) and I have 5 users (u1 - u5), I'm trying to build a system where, I can record a checkout date when U1 takes C1 and then record when he checks it in. Thats all fine and simple to do, the part I'm having a hard time visualizing is lets say I have the following.
cam user checkout checkin
C1 U1 1/1/01 1/5/02
C2 U2 2/2/02 2/5/02
C3 U3 3/8/03 1/5/04
C1 U3 3/8/03
C2 U1 4/5/04
Now on my main page, I want to be able to display what is the 'latest' status of all cams, so in theory it should look like:
cam user checkout checkin
C1 U3 3/8/03
C2 U1 4/5/04
C3 U3 3/8/03 1/5/04
I figured, I cannot use a datagrid because it'll just pull out all the data from the table, as where here, I only want the information of the latest status of each cam.
Further more, if I click on any cam under the colum cam, i'd like to have a history of all information on each cam.
What would I need to display only the latest information?
Right now I have 3 tables. I have a user table, a camera table, and a checkout table that has user and camera as foreign keys. I thought, i might have to have a seperate query for each camera, so select * from cam where cam = c1 sort date asc, and figure it would just take the top data.
However, that seems wrong to me. Any help would be appreciated.