You are here: Simple SQL query question « MsSQL Server « IT news, forums, messages
Simple SQL query question

Posted by Erich93063 on 01/11/06 20:13

I am trying to query a table of items There is a field for the name of
the item, price, quantity etc. When I query I would like to return a
"total price" which would be price * quantity and alias it out as
"Total". So something along the lines of:

SELECT vchrItem,
monPrice,
intQuanity,
(monPrice * intQuantity) AS Total,
...
FROM ...
WHERE intTableID = 12345

Obviously thats NOT how you do it but that is what I am trying to do. I
NEED this to come out in the query as I cannot calculate this
afterwards. The total value needs to be part of the recordset.

THANKS!!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация