List the requirements modified in the last 24 hours
Public Function RetrieveModifiedRecords()

' List the requirements modified in the last 24 hours
' Also demonstrates formatting time for use in filter

On Error GoTo ErrorHandler:

    Dim m_filter As TDAPIOLELib.TDFilter
    Dim oReqFactory As TDAPIOLELib.ReqFactory
    Dim ReqList As List
        
    Set oReqFactory = tdc.ReqFactory
    Debug.Assert Not oReqFactory Is Nothing
    
    Set m_filter = oReqFactory.Filter
    Debug.Assert Not m_filter Is Nothing
    
    Dim sinceDate As Date, currentSyncDate As Date
    sinceDate = DateAdd("d", -1, Date) '24 hours ago
    currentSyncDate = Date ' Now
    
    ' Create the filter, formatting the Date type
    '  as the required string:
    '  RQ_VTS > "2007-04-15 00:00:00" AND <> "2007-04-16 00:00:00"
    m_filter.Filter("RQ_VTS") = "> " _
        & Chr(34) & Format(sinceDate, "yyyy-mm-dd hh:mm:ss") & Chr(34) & _
        " AND <> " & _
        Chr(34) & Format(currentSyncDate, "yyyy-mm-dd hh:mm:ss") & Chr(34)
        
   
'    Sort by parents before children.
'    m_filter.Order("RQ_REQ_PATH") = 1
'    m_filter.OrderDirection("RQ_REQ_PATH") = TDAPIOLELib.TDOLE_ASCENDING
    
    ' Sort by modification time.
    m_filter.order("RQ_VTS") = 1
    m_filter.OrderDirection("RQ_VTS") = TDAPIOLELib.TDOLE_ASCENDING
    
    Set ReqList = m_filter.NewList
    Dim r As Req
    For Each r In ReqList
        Debug.Print r.Name
    Next
 
 
    Exit Function
    
ErrorHandler:
    err.Raise err.Number, err.Source, err.Description
End Function