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 2008 Forums
 Transact-SQL (2008)
 select query getting the percentage amount

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2011-03-18 : 12:29:41
i have PctCompleteas 107%
awardAmount = $10,000

How can i get the 107% complete of award amount using select query as thirdt column in the following query.

select pctComplete, awardAmount from Budgettable where budgetid=12

thank you very much for the helpful info.

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-03-18 : 12:35:35
Is pctComplete a string? Is it actually in '107%' format. Also awardAmount, what is it's data type?

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2011-03-18 : 12:37:11
Sorry Its a number Int field: 107.
Go to Top of Page

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2011-03-18 : 12:38:11
AwardAmt is Float datatype, just numbers there in the field no dollar signs.
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-03-18 : 12:53:55
select pctComplete, awardAmount, (PctComplete/100.0)*awardAmount
from Budgettable where budgetid=12

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -