Page 1 of 1

Alarm filtering by DB query

Posted: Tue Jan 08, 2013 12:40 am
by smolenak
Hello,

what would be proper syntax for querying ActiveTime column (datetime) from AlarmServer table (Database.sdf)?
I have datetime format like 8.12.2013 8:26:26.

This is ok and works:
DatabaseViewer1.SendSelectQuery("Select * from AlarmServer", "Database.sdf");

This for example fails.. It just doesn't return anything, althought I have alarms in DB within those dates.
DatabaseViewer1.SendSelectQuery("Select * from AlarmServer where ActiveTime > 5.1.2013 00:00:00", "Database.sdf");


Thanks!

Re: Alarm filtering by DB query

Posted: Tue Jan 08, 2013 9:47 am
by mark.monroe
Take a look at this forum post. It points you to the DatabaseViewer. That can be used to test your database queries.

There are many SQL references available on the internet. You should take a look at them and use the DatabaseViewer.exe to run test queries against your database.

You can either export a database from your HMI, or you use the Sample_Alarm project, that comes with iX Developer, on your PC to populate a database with sample alarms.

First run the project on your PC and cause a few alarms. Then open the below file using DatabaseViewer.exe.

C:\Users\Public\Documents\Beijer Electronics AB\iX Developer 2\Sample Projects\Sample_Alarm\Temp\Output\Database.sdf

C:\Program Files (x86)\Beijer Electronics AB\iX Developer 2.0.356\Bin\DatabaseViewer.exe