1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

GQL error when formatting datetime query

Discussion in 'Programming/Internet' started by James Morrison, Sep 12, 2018.

  1. I'm attempting to format a GQL query that pulls data between two dates. I've referred to several existing StackOverflow threads (GQL SELECT by date for example), and have tried following the formatting shown there, but for some reason when I test my query out it gives me an error.

    Here is the query I'm attempting to use:

    SELECT * FROM Packets WHERE timestamp > DATETIME(2017,12,23) AND timestamp < DATETIME(2017,12,29) LIMIT 10


    It gives this error:

    "GQL query error: Encountered "2017" at line 1, column 50. Was expecting one of: <SINGLE_QUOTE_STRING>, <DOUBLE_QUOTE_STRING>"


    I've tried enclosing the dates in strings, I've tried using the DATE object, every format I can think of gives me some sort of error. What am I doing wrong?

    Login To add answer/comment
     

Share This Page