If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Excel SQL Query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-01-04, 13:53
stahly stahly is offline
Registered User
 
Join Date: Feb 2004
Posts: 11
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
Reply With Quote
  #2 (permalink)  
Old 04-01-04, 13:57
stahly stahly is offline
Registered User
 
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'
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On