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 |
|
Chloe_19
Starting Member
44 Posts |
Posted - 2012-04-09 : 21:41:02
|
I am trying to:SUM up the UNITS per DATE and then average the numbers.Example below:ID UNIT DATE YILED PER DATE9876 SIB 1/01/2011 9876 JIB 1/01/2011 29876 LOP 31/01/2011 19876 DOP 2/02/2009 9876 POP 2/02/2009 9876 BIL 2/02/2009 3 AVERAGE >> 2 So end result would look like this:ID AVERAGE9876 2 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-04-09 : 22:51:23
|
AVG([YILED PER DATE]) KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Chloe_19
Starting Member
44 Posts |
Posted - 2012-04-09 : 23:20:34
|
| I am aware of the AVGIts the yield statement that gives me problems. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-04-10 : 00:05:14
|
can you show us the query ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Chloe_19
Starting Member
44 Posts |
Posted - 2012-04-10 : 00:16:02
|
| Sorry dont have it.Just the detailed above. |
 |
|
|
Chloe_19
Starting Member
44 Posts |
Posted - 2012-04-10 : 00:16:07
|
| Sorry dont have it.Just the detailed above. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-04-10 : 00:26:31
|
then post your table schema with the sample data and the required result KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Chloe_19
Starting Member
44 Posts |
Posted - 2012-04-10 : 02:35:52
|
| Never mind khtan.Got it.Thanks for the help. |
 |
|
|
|
|
|