Here is my table and query
Table 1
AsOfDate Value
2015-06-06 11:08:21.247 5
2015-06-06 12:08:21.247 7
2015-06-07 10:08:21.247 8
2015-06-08 11:08:21.247 8
2015-06-08 10:09:21.247 9
SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, [AsOfDate])) as DateOnly ,Min([Value])
FROM Table1 group by DateOnly
I am getting an error message "Invalid column name 'DateOnly'."
What would be the best way to accomplish it?
Change your query from :
To
the alias
DateOnly
is known to thie level of query ( only to top of it)