Results 1 to 12 of 12
  1. #1
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283

    Data Type

    Hello,



    just a quick dumb question guys, I have a data type that is a Number in my one table which is called Table1 and the format is 0.00. The field is called Num1. I want to update this field onto Table2 field Num2. But this data type of Num2 is Text. When i create an update query and update the Num2 field, the result shows just 0, not 0.00. I thought the text data type should just copy whatever the number field is?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Displaying the .00 is a format setting in the table. It is not actually in the data. If you want to save the .00 then use Format() function on the data. Why save number data to text field? Why duplicate data?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    It is a formatting thing. Apparently, zeros are not displayed by default. Maybe the format function will give you what you need. If you include your number type the result of the format function will be text and the formatting will be retained.

  4. #4
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    Okay so make it Format([Num1],0.00)?

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    That looks about right

    You can add a comma for 1000 separator, etc
    Format([Num1], #,000.00)

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Almost. Need quote marks.

    Format([Num1], "0.00")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    Thanks guys!

  8. #8
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    I didn't get to try it last night but I tried it today and it still doesn't work..it still shows it at 0

  9. #9
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    Am I supposed to have the format for that field set to 0.00 also? but then when I try to update the other table and it's a text data type it shows it as 0

  10. #10
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    If Table2 field Num2 is of Data type Number it will convert a string to number type. If it is possible to do so, the text string will be cast to a number. Perhaps what you want to do is format your second table's Num2 field. I suggest putting the formatting in a query or, better yet, in a form. This way the formatting is employed only when absolutely necessary.

  11. #11
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    I just made the query to update the text data type..it works. I just don't understand why it wouldn't transfer over to show it at 0.00

  12. #12
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I am having difficulty understanding what you have tried and what is working for you. Why don't you explain what you did that is creating a question and post the relative code.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How Do I Change Data Type
    By LeadTechIG in forum Database Design
    Replies: 9
    Last Post: 01-07-2015, 03:05 PM
  2. data type mismatch
    By ottoc in forum Queries
    Replies: 1
    Last Post: 12-02-2014, 09:42 AM
  3. Data Type to input data number
    By TioAdjie in forum Access
    Replies: 5
    Last Post: 02-17-2014, 11:21 AM
  4. Replies: 3
    Last Post: 05-31-2013, 04:32 PM
  5. Replies: 2
    Last Post: 03-18-2010, 08:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums