Skip to main content
ilssac
Inspiring
November 10, 2011
Answered

queryNew date and time type only precise to the second?

  • November 10, 2011
  • 1 reply
  • 1650 views

I am creating a set or query using queryNew() functionality to split up a larger query into related parts.  One of the fields in the larger query is a date-time filed with millisecond data that is relevant to proplerly sort the records.  Apparently the date and time data types of the queryNew() function are precise to only the second and is truncating the necessary millisecond data.

First question is there any way to change this behavior and have the queryNew() date and|or time data types be more precise.

This topic has been closed for replies.
Correct answer Owainnorth

Oh, plus I'm a muppet. Use "timestamp" as the data type.

1 reply

Owainnorth
Inspiring
November 10, 2011

QueryNew() does support 64-bit integers ("BigInt") - how about storing the dates as milliseconds since 1970 or something like that? Would obviously require a couple of conversion functions but would get around your issue here.

Owainnorth
OwainnorthCorrect answer
Inspiring
November 10, 2011

Oh, plus I'm a muppet. Use "timestamp" as the data type.

ilssac
ilssacAuthor
Inspiring
November 10, 2011

Thanks Owain.

It would be nice if timestamp was listed in the documentation online as an option, then I would have already tried it on my own.

Ian