Question:
I am creating an Java Application which takes in a text file with Wireless Devices and Locations these Devices are supposed to be in, and compare it to device history data stored within within a SQL database.
A feature of the Application is to compute the total percentage of time the Device was located within the proper location ((which is # of times device is in proper location/total # of times device is in a location) * 100) over a certain time duration which is inserted by the user.
One table has a macaddress field and a ID field.
The other table has a historyID field (foreign key to first table) a starttime field, endtime field, and a location field.
How can I query the Database to get an accurate count of how many times the device appears in the proper Location WITHIN the user-inserted time duration? I need to account for the starttime and endtime fields, which are in the DATETIME format and are exclusive to each history entry and can be used as boundaries for the user-inserted time. Any help would be appreciated.
Thanks
-vza
I am creating an Java Application which takes in a text file with Wireless Devices and Locations these Devices are supposed to be in, and compare it to device history data stored within within a SQL database.
A feature of the Application is to compute the total percentage of time the Device was located within the proper location ((which is # of times device is in proper location/total # of times device is in a location) * 100) over a certain time duration which is inserted by the user.
One table has a macaddress field and a ID field.
The other table has a historyID field (foreign key to first table) a starttime field, endtime field, and a location field.
How can I query the Database to get an accurate count of how many times the device appears in the proper Location WITHIN the user-inserted time duration? I need to account for the starttime and endtime fields, which are in the DATETIME format and are exclusive to each history entry and can be used as boundaries for the user-inserted time. Any help would be appreciated.
Thanks
-vza