Results 1 to 2 of 2

Thread: Excel SQL Query

  1. #1
    Join Date
    Feb 2004
    Posts
    11

    Unanswered: Excel SQL Query

    I am looking to automate a worksheet to pull data down from a database, so far so good. the next step i need to do is to have 2 fields multiply. i am not sure what code i am missing in my SQL, here is my working sql to pull the data down...

    SELECT Results.Description, Results.Unit, Results.Location, Results.Price, Extra.Quantity
    FROM Extra Extra, Results Results
    WHERE Results.PKey = Extra.Pkey2
    ORDER BY Results.Description

    any ideas, thoughts, comments, etc... would be greatly appeciated. thanks.

    adam

  2. #2
    Join Date
    Feb 2004
    Posts
    11
    I swear this always happens to me. i posted this and no more than 5 minutes later, i got it solved. just incase anyone else will ever need this for future references. heres what i got...

    SELECT Results.Description, Results.Unit, Results.Location, Results.Price, Extra.Quantity, (extra.quantity*results.price) AS 'Total'
    FROM Extra Extra, Results Results
    WHERE Results.PKey = Extra.Pkey2
    ORDER BY Results.Description




    the added part is:
    (extra.quantity*results.price) AS 'Total'

Posting Permissions

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