Results 1 to 3 of 3
  1. #1
    teja is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    31

    When text field is used in Sum() function, it is adding them like the field is number

    Hi all,



    I have an access database that imports data from a Excel sheet. All the columns are text datatypes.

    when i run the query - Select Sum(Tablename.column1) From Tablename group by column2;

    where the column1 has numbers (but the column type is "Text"), the result is same as when a number datatype field is added.

    Kindly explain.

    Also, similar observation is made incase of SELECT col1+col2 FROM table;

    where col1 and col2 are text datatype but have number values. I thought the result will give concatenated string instead of added up value.

    Does access internally recognize them as numbers????

    Thanks in advance.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    To get a concatenated string, use & instead of +
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    teja is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    31
    Quote Originally Posted by Bob Fitz View Post
    To get a concatenated string, use & instead of +
    But why the result is addition for text type.... I mean if the column type is text... and i am using that column in Sum() function then datatype mismatch error must be shown... I guess!

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

Similar Threads

  1. Splitting a number field across 4 text boxes
    By R_Badger in forum Reports
    Replies: 1
    Last Post: 02-06-2012, 06:12 AM
  2. Replies: 20
    Last Post: 09-06-2011, 12:39 PM
  3. Convert number to fixed length text field
    By tpcervelo in forum Queries
    Replies: 1
    Last Post: 08-02-2010, 07:26 PM
  4. Field switching from Number format to Text
    By COforlife in forum Queries
    Replies: 1
    Last Post: 11-10-2009, 03:23 PM
  5. Concatenate two fields (text & number) for key field
    By Larry Elfenbein in forum Forms
    Replies: 2
    Last Post: 11-10-2005, 07:45 AM

Tags for this Thread

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