Adding Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aftab Ahmad
    New Member
    • Jan 2015
    • 49

    Adding Problem

    Hi there!
    I have two queries i.e. Query1 and Query2. Query1 related to purchasing stock while the other one is to related with Sales. I have create another Query with the help of these two queries (with Query1 & Query2) and named it "Statement" . Now problem is that the total quantity of Products in Query1 and total sales in Query2 were not added to each other instead these were combined. Like,
    ------------------------------------------------------
    Product Name | TotalQty | TotalSale | GrandTotal
    ------------------------------------------------------
    Gen-M250 MG Tab. | 100 | 50 | 150
    ------------------------------------------------------
    As you see, 100+50 will be 150 but GrandTotal value after adding is shown as "10050". What should I do? Thanks in Advance.
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1293

    #2
    It's hard to know what is going on for sure because we see nothing but the small bit you are telling us. It could be you have some fields incorrectly defined in a table. Or your query(ies) could have problems.

    100+50 gives 10050 if those are string fields; it gives 150 if those are numeric fields. Start with your table definitions. Make sure those are right for the type of data you are capturing. Then let's see what your queries look like.

    Jim

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32656

      #3
      Exactly as Jim says, you're using the + character with at least one of the values being string in nature. This has a special meaning in Access and SQL which is to concatenate the two values rather than to add them arithmetically.

      Check in the query that produces the results first, and if not found then each of the other two queries, for either or both of your numerical results being converted to visible format by use of the Format() function or something similar.

      Comment

      Working...