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.
| Author |
Topic |
|
lauramayer
Posting Yak Master
152 Posts |
Posted - 2005-08-02 : 12:42:21
|
Afternoon,I know there is a way to make this work but I can't seem to hit on the right combination. I need it to NOT round down or up for that matter. For example in one result set the answer I should be getting is "1990.37931" using this syntax: CAST(Avg(MODELYEAR) AS decimal(10,5)) AS AvgOfMODELYEAR I get 1990.00000.Any nudge in the right direction would be greatThanksLaura |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-08-02 : 12:44:29
|
try Avg(CAST(MODELYEAR AS decimal(10,5))) AS AvgOfMODELYEARGo with the flow & have fun! Else fight the flow |
 |
|
|
lauramayer
Posting Yak Master
152 Posts |
Posted - 2005-08-02 : 12:51:36
|
Are you kidding? I've been banging my head against the wall for one little set of parentheses?! Yikes!!Thank you so much. I knew someone here would know.Thanks again.Laura |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-08-02 : 13:30:04
|
a thing to remember... always cast the value directly and not the aggregated value.Have a nice day.Go with the flow & have fun! Else fight the flow |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-08-02 : 13:58:43
|
| Evening lauramayer,You need a different set of parentheses?'Cor blast, I wish I'd known, we charge extra for them!Kristen |
 |
|
|
lauramayer
Posting Yak Master
152 Posts |
Posted - 2005-08-03 : 07:46:20
|
| Yes it's the little things.... |
 |
|
|
|
|
|