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 |
|
vinay.varala
Starting Member
3 Posts |
Posted - 2012-09-06 : 06:08:07
|
| create proc sp_hrdate@red datetimeas begindeclare @Reading_Date datetime set @Reading_Date=@redselect DatePart(hour,@Reading_Date) as hour, convert(Date,@Reading_Date,103) as date, avg(Fuel_Level)as fuel_level,avg(Fuel_Volume)as fuel_volume from Levelswhere Simmons_PanelID=5479group by DatePart(hour,@Reading_Date),convert(Date,@Reading_Date,103) order by DatePart(hour,@Reading_Date) endcan anyone help me in get rid of this cheers.. |
|
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2012-09-06 : 06:49:42
|
| comment the group by clause and try |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-09-06 : 06:56:34
|
| Removing the GROUP BY clause will stop SQL from complaining. However, I think there is more to the query than what you have in there. The parameter @red being provided means something doesn't it? What are you trying to calculate? The levels and volumes within that hour? Or levels and volumes for a range? The way you have written the query now, the calculations are not using the parameter at all.If you describe what you are trying to calculate, someone on the forum would be able to suggest required changes. |
 |
|
|
|
|
|
|
|