Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Coding a monthly interval into SQL statements

Hello,

I've got a logger object that is logging data on the 1st of every month. When I generate a query against the Traces table for records in a specific timespan, it only returns the first record if I don't provide the Interval="??:??" argument. Therefore I was wondering how you would structure the Interval argument to handle the variable length of our months.

Regards,
Derek McClure
0 Kudos
Message 1 of 3
(2,929 Views)
Derek

probably you can use the specific word MONTH as interval. As it states in the Lookout development manual Appendix B, Accessing Citadel Data with SQL.

Interval=MONTH
Interval=YEAR
Interval=WEEK

are some of the specific words for intervals. Non defined intervals defaults to 1 (day).

Side comment:
I assume you would have at least 2-3 values logged a day to do some propre 1-day queries and to avoid getting back some not-a-number values. If you do specific 1st of every month triggered data logging you might consider to query against the points table (if you can live with single trace queries).

Let us know if this solves your issue.
Roland
Message 2 of 3
(2,929 Views)
Roli,

Thanks for the info. I missed those keywords when I was researching the SQL.

Derek
0 Kudos
Message 3 of 3
(2,929 Views)