---
title: "sql server aggregate float values"  
description: "sql server aggregate float values"  
author: "Anonymous User"  
published: 2013-05-08  
updated: 2013-05-08  
canonical: https://www.mindstick.com/forum/836/sql-server-aggregate-float-values  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 1 minute  

---

# sql server aggregate float values

Hi Everyone!\
How to get [aggregate](https://www.mindstick.com/blog/52/aggregate-functions-in-database) float [values in sql](https://www.mindstick.com/forum/159818/how-to-use-the-coalesce-function-to-handle-null-values-in-sql-queries) [server](https://www.mindstick.com/articles/43769/what-is-serverless-architecture-is-it-worth-switching-over) 2008. I'm try as following\
declare @cy [datetime](https://www.mindstick.com/forum/12949/how-to-validate-if-a-datetime-field-is-not-null-empty)set @d = '12/01/2010'\
[select](https://www.mindstick.com/forum/160534/orderby-then-select-vs-select-then-orderby-performance) SUM(total) from (select sum(amt1) as total from table1where date1 < @d [union all](https://www.mindstick.com/blog/11268/union-and-union-all-operator-in-sql)select sum(amt1) as total from table1where date1 >= @d) as a \
thank in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!

## Replies

### Reply by AVADHESH PATEL

Hi Ankita!\
I suspect you are using [UNION](https://www.mindstick.com/articles/1510/union-example-in-sql-server) because there are actually two different tables in your queries, e.g., table1 and table2. In that case, you should not expect the sum to be the same when the date changes.\
Update: I just noticed that you are selecting amt in one query and amt1 in the other, so there is no reason to expect the sums to be the same as the date changes.\


---

Original Source: https://www.mindstick.com/forum/836/sql-server-aggregate-float-values

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
