Results 1 to 4 of 4

Thread: Float and int

  1. #1
    Join Date
    Jul 2003
    Posts
    70

    Unanswered: Float and int

    I imported Leave balance from one source table and dumped it into another table.

    Structure of the tables
    Source Table: Table1 (employee_id int, leave_balance float)

    Destination Table: Table2(employee_id int, leave_balance int)

    In the destination table, without knowing i created the leave_balance data type as int. I have pushed all the data from table1 to table2, and after this, i dropped table1.

    Now in table2, i have all the decimal values wiped off. For example, there were data of leave_balance like 10.5 in table1, which is showing as 10 now in table2. Can i do something on table2 which can show data as it was in table1?

    Thanks
    qA

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    The precision is now lost in Table2. You will have to restore your data from a backup and repeat the job correctly this time.
    Also, what is leave_balance?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by pootle flump View Post
    Also, what is leave_balance?
    my guess: number of days (including fraction, apparently) that an employee may take on leave, i.e. vacation balance
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    My guess too - I just want to be sure it is not something where float rounding display is going to cause problems.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •