Results 1 to 8 of 8
  1. #1
    Debron101 is offline Novice
    Windows 10 Access 2007
    Join Date
    Feb 2021
    Posts
    3

    Adding togther the results of a calculated field from 2 different queries

    This seems that it should be such an easy thing to do...
    In Query 1, I am multipling an order quantity from 1 table and Sales Price of another table to give a total order cost
    In Query 2, I am doing the same but with a different table for the order quantity
    I now want to add the total order cost together.


    The result it always blank.
    What I am missing?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Post the SQL of your query(s).
    Perhaps you could describe the purpose of your database and tell us about the tables behind the query(s).
    Last edited by orange; 02-17-2021 at 01:05 PM. Reason: spelling

  3. #3
    Debron101 is offline Novice
    Windows 10 Access 2007
    Join Date
    Feb 2021
    Posts
    3
    SELECT Order_With_Values_050421.[Item Code], Order_With_Values_050421.[Item Name], Order_With_Values_050421.Total, Order_with_Values_190321.Total
    FROM Order_With_Values_050421 INNER JOIN Order_with_Values_190321 ON Order_With_Values_050421.[Item Code] = Order_with_Values_190321.[Item Code];
    I want to add the 2 order_with_values colums together.
    It just seems like a simple thing but I must be missing out a stage,
    Thanks in advance for any help

  4. #4
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Hi
    Can you upload a zipped copy of the database?
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  5. #5
    CarlettoFed is online now Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    255

    Risposta

    A solution could be the following:
    Code:
    SELECT Order_With_Values_050421.[Item Code],  Order_With_Values_050421.[Item Name], (Order_With_Values_050421.Total +  Order_with_Values_190321.Total) AS Totals
    FROM Order_With_Values_050421 INNER JOIN Order_with_Values_190321 ON  Order_With_Values_050421.[Item Code] = Order_with_Values_190321.[Item  Code];

  6. #6
    Debron101 is offline Novice
    Windows 10 Access 2007
    Join Date
    Feb 2021
    Posts
    3
    Quote Originally Posted by mike60smart View Post
    Hi
    Can you upload a zipped copy of the database?
    I have uploaded the zipped file
    Attached Files Attached Files

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    Look at your data in the query. There is no record with a value in both fields (i.e. no item code exists in both tables based on that query) so there is nothing to add.
    You would be doing yourself a favour if you didn't use special characters and spaces in your object names. You should not be creating multiple tables that look the same either. Access is not Excel, like where you might create multiple sheets that look the same. I think you need a primer in db normalization and design.
    Last edited by Micron; 02-17-2021 at 04:12 PM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    In addition to Micron's comments about not using spaces/punctuation/special characters. you should never begin object names with a number. The Access gnomes can get obstinate and cause problems.

    You need to be able to determine what are the attributes you want to record (a sales date) and what is data. Naming the tables with the "UK Del Date" (sales date?) means you could potentially have at least 356 tables.

    It would help if you would answer orange's question: "Perhaps you could describe the purpose of your database and tell us about the tables behind the query(s).".

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

Similar Threads

  1. Adding Calculated Field to Table with VBA
    By virgilio in forum Programming
    Replies: 8
    Last Post: 08-28-2020, 04:40 PM
  2. Replies: 8
    Last Post: 07-16-2018, 09:01 AM
  3. Replies: 3
    Last Post: 07-01-2016, 08:11 AM
  4. Calculated field on results in the same query
    By becka11 in forum Queries
    Replies: 1
    Last Post: 05-07-2013, 05:11 PM
  5. Replies: 3
    Last Post: 06-26-2012, 02:54 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