MySQL set Length/decimal for Double and bigint

Posted on 2011-05-03
Last Modified: 2012-06-27
I want to store OAdateTime in MySQL column (double)

What would be setting fro Length and Precision?

For bigint i set lenght to 20 and 0 for precision is this alright?

Question by:JSW21
    LVL 40

    Accepted Solution

    Is OAdateTime a date column? Then why don't you define it as datetime or date depending on your data?
    LVL 59

    Assisted Solution

    by:Kevin Cross
    I agree with Sharath.  If you do, however, have to store as a DOUBLE, then use that data type or DECIMAL and not BIGINT.  A double-precision floating point number is imprecise and can go up to 53 digits in precision --- if you are trying to simulate the length then go with DECIMAL.

    Author Comment

    MySQL do not have millisecond so i need to use such field.
    But my data require primary key on OAdateTime would the float(0,0) works?

    Author Closing Comment

    I got my problem solve. When create double I should just let the database decide the precision.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    I have been using r1soft Continuous Data Protection ( for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
    PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now