Filter Files on Timestamp

Stef-B
Member Posts: 26
I need to set a filter on the Time field of the virtual File Table.
The filter should show only the Files with a Time < now-5Minutes (e.g. older then 5 Minutes)
I tried so many ways to convert currentdaytime back and forth and nothing worked.
Most likely it's a simple task but right now im a little bit helpless.
Thank you in advance
Stef
The filter should show only the Files with a Time < now-5Minutes (e.g. older then 5 Minutes)
I tried so many ways to convert currentdaytime back and forth and nothing worked.
Most likely it's a simple task but right now im a little bit helpless.
Thank you in advance
Stef
0
Answers
-
What about moving "old" files after processing them into another folder and have rule, that in this folder are only files to be processed?0
-
The files I want to ignore are probably not completely finished, as the program that fills them takes some minutes to build them. If I start the reading process on a not finished file I get unpredictable conditions, and I just want to avoid this.
My problem ist to determine what is a new file. Wether in the filter or later in the Repeat Until Loop. I have difficulties to compare the timestamp with a value of Time-5Minutes.
Could you help me with this? I just never programmed something with Time up until now. I Know how to calculate with date and dateformula but not with time.0 -
To test if file is finished you can try to open it for Write mode... if it fail, the file is open by someone else...
The second process could create the files in different folder and move only finished files into the target folder for processing...0 -
My experience is that Kines suggestion is the best way to do it. If you move the files then its much reliable.David Singleton0
-
That just won't help!
The Files are created line by line and are not locked in the time between (2-5 Seconds inbetween each line). I can not influence this behaviour. I just have to wait a certain amount of time after the creation time. that's all i want. After i processed the files in Nav i move them to a different folder but that wont help me in the beginning. so i ask again
How do I calculate a Time minus 5 five minutes? What variable type do I need to compare this to the timestamp value of the File Rec.0 -
Hi Stef,
You can simply subtract milliseconds from a time.YourTime := TIME - (1000 * 60 * 5);
Regards,Reijer Molenaar
Object Manager0 -
:thumbsup:
Thats it! Works perfect! so simple.. working with integer ... and I tried with variables with datetime and back and forth... ](*,)0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions