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

Posted by Hugo Kornelis on 01/11/06 21:38

On 11 Jan 2006 10:13:11 -0800, Erich93063 wrote:

>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.

Hi Erich93063,

This is EXACTLY how you do it.

Did you run the code and get an error or incorrect results? If so,
please post more specific information (e.g. the text of the error
message) to help us troubleshoot. See www.aspfaq.com/5006 to find out
what information we need to help you.

--
Hugo Kornelis, SQL Server MVP

 

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

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