Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8355751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:57:45+00:00 2026-06-09T09:57:45+00:00

I am trying to convert decimal value to date in select statement SELECT user_id,

  • 0

I am trying to convert decimal value to date in select statement

SELECT user_id, extend(dbinfo("UTC_TO_DATETIME",min(creationdate)), year to fraction) AS earned_date
FROM message

But I am getting this error

 Value exceeds limit of INTEGER precision

The field definition in table is this

  creationDate      decimal(14,0) NOT NULL

It seems I am not using the right way to do the conversion, any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T09:57:48+00:00Added an answer on June 9, 2026 at 9:57 am

    I don’t think you need to use EXTEND in this context – EXTEND is used to change the scale of DATETIME and INTERVAL values.

    UTC_TO_DATETIME returns a DATETIME value already.

    Have you tried:

    SELECT user_id, dbinfo("UTC_TO_DATETIME",min(creationdate)) AS earned_date
      FROM message
    

    What does that produce?

    UPDATE

    Ahh, an example makes all the difference!

    The value you are passing is not a UTC datetime as UTC_TO_DATETIME expects. The function expects an integer representing seconds, not milliseconds. It’s as simple as that.

    DBINFO('UTC_TO_DATETIME', 1329994172574) exceeds integer precision.

    DBINFO('UTC_TO_DATETIME', 1329994172574/1000) on the other hand, produces:

    2012-02-23 21:49:32, which I guess is what you expect?

    If you have a look at the link I provided earlier, it explains treatment of fractional seconds. (Spoiler: they’re ignored.)

    If the fractional seconds are critically important, I guess you’re going to have to EXTEND the results of this function to fractional seconds, and then add MOD(creationdate,1000)/1000 to it.

    For example:

    SELECT user_id, 
          (dbinfo("UTC_TO_DATETIME", MIN(creationdate)/1000 )::DATETIME YEAR TO FRACTION(3)
            + (MOD(MIN(creationdate),1000)/1000) UNITS FRACTION) AS earned_date
      FROM message
    

    (But personally, I would be inclined to put this logic into an SPL anyway, so you could call it like:
    SELECT user_id, millis_to_time(MIN(creationdate))... and avoid writing this sort of complex algorithm all over the place.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert an object with the value 0.39999999999999997 to a decimal variable
I am trying to convert FFAD (hex) to a decimal value and then do
I am trying to convert decimal value to string. My coding is this: public
In C#, I'm trying to convert a string to decimal. For example, the string
im trying to convert a date format into a new format in this example
I'm trying to format a decimal value with decimals to a custom format without
I'm trying to to convert from a decimal number into a binary number. Have
I am trying to convert a decimal colour code from a Flash Application into
I am trying to convert a decimal to text. Every time I try to
CAST() seems to only work for BINARY,CHAR,DATE;DATETIME,DECIMAL,TIME,SIGNED,UNSIGNED. I need to convert a hex string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.