What I am doing is making a report displaying all the trucks that are inactive for a certian amount of time. The time that we are going to use is selected from a dropdown box(1-24hours)
So, if I pick 3 from the dropdown box, I want to display all the trucks that have been inactive for over 3 hours.
I think I just have to modify the query that I have made from another post. (
I am pretty sure that I will have to use a between, sys_date, and some others, but have no idea where to start.
The query below displays all the trucks in the table, last location. but now i want their last location if the idle time has been over a certian amount of
I think I have to put that entire query as a sub query...??
wow, im confused...lol
Thanks
So, if I pick 3 from the dropdown box, I want to display all the trucks that have been inactive for over 3 hours.
I think I just have to modify the query that I have made from another post. (
I am pretty sure that I will have to use a between, sys_date, and some others, but have no idea where to start.
The query below displays all the trucks in the table, last location. but now i want their last location if the idle time has been over a certian amount of
Code:
SELECT
QATech_DataStore."cust_trucks"."truck_name",
p."date_time",
p."location3distance",
p."location3"
FROM
QATech_DataStore."cust_positions" p,
QATech_DataStore."cust_trucks"
WHERE
p."date_time" = (
SELECT Max( "date_time")
from QATech_DataStore."cust_positions" p2
WHERE p2."asset_id" = QATech_DataStore."cust_trucks".Oid
AND p2."asset_type_id"=2)
AND
QATech_DataStore."cust_trucks".OID = p."asset_id"
I think I have to put that entire query as a sub query...??
wow, im confused...lol
Thanks