database logging and reporting SOLVED
database logging and reporting SOLVED
I am logginf to a odbc msaccess database. I want to strip the % off the end of the replies for Alive and Dead because when I try to run a query to give me the average of a certain test I get a error that says mismatched data. I have been doing this through a query in access but over time the log has grown and it takes to long to complete the query now. Is there a way to strip that % sign off the end of the reply before it gets posted to the database?
Last edited by ericm on Mon May 22, 2006 12:03 pm, edited 1 time in total.
For Reply field you may use Reply_Number or Reply_Integer variables, but for AliveRatio and DeadRatio you should try MSAccess string function to strip ' %'. I know nothing about MSAccess functions, but in MySQL it looks like Replace('%AliveRatio%',' %','')
http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro
E.g. INSERT INTO hmlog (DATE1, TIME1, TEST_NAME, TestID, STATUS, REPLY,ALIVERATIO) VALUES (%Date%, '%Time%', '%TestName%', %TestID%, '%Status%', '%Reply%',Replace('%AliveRatio%',' %',''))
It works.
Regards,
Yoorix
http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro
E.g. INSERT INTO hmlog (DATE1, TIME1, TEST_NAME, TestID, STATUS, REPLY,ALIVERATIO) VALUES (%Date%, '%Time%', '%TestName%', %TestID%, '%Status%', '%Reply%',Replace('%AliveRatio%',' %',''))
It works.
Regards,
Yoorix
Did you try to execute such clause in Access worksheet directly? What SQL Error do you see? Could it be syntax error?ericm wrote:maybe it is my setup but the replace function does not work with a odbc connection.
Maybe, you should perform additional data convertion, like Cast(Replace('%AliveRatio%',' %','') as double) or something like that. You should read Access manual about conversion functions.
Regards,
Yoorix
Done. Version 6.00 available at http://www.ks-soft.net/hostmon.eng/downpage.htm
Use ODBCLog_NoPercentSign option
http://www.ks-soft.net/hostmon.eng/news.htm
Regards
Alex
Use ODBCLog_NoPercentSign option
http://www.ks-soft.net/hostmon.eng/news.htm
Regards
Alex