Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to use a calculated column later in the query

Author  Topic 

kamii47
Constraint Violating Yak Guru

353 Posts

Posted - 2008-10-23 : 03:50:59
How to use a calculated column later in the query
Select Sum(PD.Quantity) as Quantity,5 as Rate, Quantity*Rate

Quantity and Rate are calculate Columns how can i use the columns in the later part of the query.

Kamran Shahid
Sr. Software Engineer(MCSD.Net,MCPD.net)
www.netprosys.com

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-23 : 04:00:34
[code]
Select Quantity*Rate
from
(
Select Sum(PD.Quantity) as Quantity,5 as Rate
....
)t
[/code]
Go to Top of Page

kamii47
Constraint Violating Yak Guru

353 Posts

Posted - 2008-10-23 : 07:32:21
Thanks Visakh

Kamran Shahid
Sr. Software Engineer(MCSD.Net,MCPD.net)
www.netprosys.com
Go to Top of Page
   

- Advertisement -