Announcement

Collapse
No announcement yet.

Help with Query Language Syntax - Solved!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with Query Language Syntax - Solved!

    Im running Ultralog on HS2 and Im trying to get data for specific device within a certain time range.

    Ive got this so far and I cant seem to get the date range syntax correct

    SELECT ts, data1, data2
    FROM tblDeviceValueLog
    WHERE (dc = 'Q32') and

    Any help appreciated.

    #2
    I do not use Ultralog but try something like this.

    SELECT ts, data1, data2
    FROM tblDeviceValueLog
    WHERE (dc = 'Q32') and
    fieldName between TO_DATE('1/11/11', 'MM-DD-YY') and TO_DATE('12/6/2014 ', 'MM-DD-YY')
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      It gives me an error:

      Your query failed for the following reason: System.Data.SQLite function/subroutine: [5 - SQLite error no such function: TO_DATE]

      Comment


        #4
        Ah. See this explanation.
        http://stackoverflow.com/questions/4...string-to-date
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment


          #5
          Thanks for the help.

          The dates needed to be in ISO format to work:

          SELECT ts, data1, data2
          FROM tblDeviceValueLog
          WHERE (dc = 'J1') and (ts BETWEEN '2014-11-14' and '2014-11-16')

          Comment

          Working...
          X