Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, can anyone show me how to compare file time of a source file with today's date? I am trying to write script to stop the app running if file time is earlier than today's date. Thank you.
Hi,
for the file time you have this:
FileTime() => it return a timestamp, so yo should do this: Date(Filetime())
IT IS A SCRIPT FUNCTION
and for today date, you have this:
Today()
so you can compare like this:
if(filetime(file.extention) <..>..<=..>=.. today(), ..., ...) as ...
exit script when filetime( 'your file location' ) < today()
Try this and change your script accordingly.
Change the file paths and filenames accordingly.
SET vFilePath = 'P:\SetAnalysis_Udemy\';
LET vFileTime = Date(FileTime('$(vFilePath)Bubble.qvw'));
IF $(vFileTime) >= Date(Today()) Then
Load * INLINE [
Name, ID
A, 2
B, 3
C, 4
];
ELSE
Exit SCRIPT;
ENDIF;