Results 1 to 2 of 2

Thread: Counting Costs

  1. #1
    Join Date
    Apr 2007
    Location
    Stalybridge, Manchester
    Posts
    273

    Unanswered: Counting Costs

    Hi, I am not sure if I'm being thick or not but I am struggling with this.

    I have a table with Product and their costs.
    I have another table with Products bought when and who by.

    I am trying to bing together in a query a list of how much has been spent on each product.
    This query looks like this...
    [BoughtWhen] [Who by] [Product A] [Product A Cost] [Product B] [Product B Cost]

    How can I do this in a query?

    Jez

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    it all depends on your table design

    assuming your data is normalised.. i'm not sure you can immediately generate somethign like
    [BoughtWhen] [Who by] [Product A] [Product A Cost] [Product B] [Product B Cost]

    to retrieve the details of the products bought and their cost you would need to use either a join or a where clause (either works, but join is preferred)

    you give no indication of quantity bought
    normally id expect to soemthign like

    [BoughtWhen]
    [Who by]
    <itemNo>[Product ID] {Product Description] [unit cost] <QTY> <LineCost> <Sales Tax or Sales Tax rate>
    <itemNo>[Product ID] {Product Description] [unit cost] <QTY> <LineCost><Sales Tax or Sales Tax rate>
    <itemNo>[Product ID] {Product Description] [unit cost] <QTY> <LineCost> <Sales Tax or Sales Tax rate>
    <itemNo>[Product ID] {Product Description] [unit cost] <QTY> <LineCost><Sales Tax or Sales Tax rate>

    total pre sales tax
    total sales tax
    total cost to customer
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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