Hi,
1.) is it possible to use date & time macro variables for comparison with results from the ODBC/SQL Query?
2.) can I use wildcards (asterisks and so on) in a File Availability Check? File is named like this: fgh%yyyy%%mm%%dd%*.txt (the asterisk means hour, minute and second)
best regards,
sabine
Macro Variables date and time
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
Re: Macro Variables date and time
I am afraid, you cannot use date & time macro varivables in that way. However, you may use date & time variables within SQL query. I think, you may adjust the SQL query to use macro variables, e.g. you may use query:sabine wrote:1.) is it possible to use date & time macro variables for comparison with results from the ODBC/SQL Query?
Code: Select all
select count(*) where SomeDateTimeField = convert(datetime,'%mm%/%dd%/%yyyy%')
Yes, you may use wildcards within filename for a "Folder/File Availability" test. Please note, you have specified date & time macro variables within filename, you should enable "Translate Macros" option. http://www.ks-soft.net/hostmon.eng/mfra ... #fileexstssabine wrote:2.) can I use wildcards (asterisks and so on) in a File Availability Check? File is named like this: fgh%yyyy%%mm%%dd%*.txt (the asterisk means hour, minute and second)
Regards,
Max
Hi Max,
the result from the sql query is a string (filename) formated like StringYearMonthDayHourMinuteSecond. Hour, Minute and Second are not current so I can't use them for comparison. Is there any other possibility to compare the current date with the first half of the query result?
Best regards
sabine
the result from the sql query is a string (filename) formated like StringYearMonthDayHourMinuteSecond. Hour, Minute and Second are not current so I can't use them for comparison. Is there any other possibility to compare the current date with the first half of the query result?
Best regards
sabine
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
In such case you do not need to use date and time macro variables at all. You should use Date and Time functions of the SQL Server instead. For instance, for MS SQL Server you may use query like the folowing:sabine wrote:the result from the sql query is a string (filename) formated like StringYearMonthDayHourMinuteSecond. Hour, Minute and Second are not current so I can't use them for comparison. Is there any other possibility to compare the current date with the first half of the query result?
Code: Select all
SELECT count(*) from SomeTable WHERE SomeFileNameField LIKE 'String'+Convert(varchar,GetDate(),112)+'%'
So, you may specify that query into "SQL query" input box and compare result it with 0.
Regards,
Max
There is RMA for Linux version 1.24 at www.ks-soft.net/download/rma124_lini32.tgz
It supports wildcards for Folder/File Availability and Text Log test methods
PS Please use different topics for different questions.
Regards
Alex
It supports wildcards for Folder/File Availability and Text Log test methods
PS Please use different topics for different questions.
Regards
Alex