- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Filter data within date and time range
Hi.
I would like to filter data within 2 dates.
the dates are in another table.
Table 1:
Table 2:
How can I filter the data in table 1 that has END_TIME between the START_TIME and END_TIME in table 2?
I want the result in the new table.
Hope I explained it clearly.
Thank you.
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Filter data within date and time range
Here is a simple example of one type of filtering
Names Default To Here( 1 );
// Substitute the actual names of your data table
dt1 = Data Table( "table 1" );
dt2 = Data Table( "table 2" );
// This statement will select all of the rows in data table 1 that are
// between the start and end dates from the second data table
// Taking the value in the second data table's first row for the columns
// START_TIME of SideAStart and END_TIME of SideAEnd
// Not knowing what you really mean as "Filter the Data Table", this is
// a guess as to how you want to "Filter" the data
dt1 << dt1 << select where( dt2:START_TIME of SideAStart[1] <= dt1:END_TIME <= dt2:END_TIME of SideAEnd[1] );
Jim
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Filter data within date and time range
Here is a simple example of one type of filtering
Names Default To Here( 1 );
// Substitute the actual names of your data table
dt1 = Data Table( "table 1" );
dt2 = Data Table( "table 2" );
// This statement will select all of the rows in data table 1 that are
// between the start and end dates from the second data table
// Taking the value in the second data table's first row for the columns
// START_TIME of SideAStart and END_TIME of SideAEnd
// Not knowing what you really mean as "Filter the Data Table", this is
// a guess as to how you want to "Filter" the data
dt1 << dt1 << select where( dt2:START_TIME of SideAStart[1] <= dt1:END_TIME <= dt2:END_TIME of SideAEnd[1] );
Jim