Search table records by date range

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yanivt
    New Member
    • Aug 2010
    • 1

    Search table records by date range

    working on a seemingly simple problem, but for some reason it is giving me a bit of a hard time.

    I have a table with the following fields: FileID, FName, FPath, DateCreated, Owner.
    It is a simplistic recreation of a file-search on a group of folder.

    What I am trying to do is filter the table down to files where the DateCreated falls within given limits, count the number of records returned, and then use a loop to pass the FName and FPath values from each record to a simple renaming function - FileRename(Dire ctory As String, OldName As String, NewName As String).
    The new name will simply be the count number.

    I suspect the best method would be using an Array which holds the result of an SQL query, but I can't quite write something that does the trick.

    Any suggestions on the best route for this problem would be greatly appreciated.
  • Medwar19
    New Member
    • Aug 2010
    • 17

    #2
    take a look at the dateadd function to query the date range.

    Comment

    Working...