Re: Simple SQL query question
- From: Hugo Kornelis <hugo@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 11 Jan 2006 20:38:50 +0100
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
.
- Follow-Ups:
- Re: Simple SQL query question
- From: Erich93063
- Re: Simple SQL query question
- References:
- Simple SQL query question
- From: Erich93063
- Simple SQL query question
- Prev by Date: Re: show stored procedure
- Next by Date: Re: Simple SQL query question
- Previous by thread: Simple SQL query question
- Next by thread: Re: Simple SQL query question
- Index(es):
Relevant Pages
|