Now i need to show 3 months data, and link that data to another table using a TimeStamp column. So i need to get a OUTPUT like below so i can link the two ReadTimes columns together in SQL editor(excel)

Can anyone help me to create a query to count the timestamps, and sum the watthours and return a extra column with the 1st day of the month, @ 0:00:00 as the readtime so i can link it to another table.

This code will give you the extra column with the first day of the month. I've calculated this with DATEADD combined with the DATEPART of [TimeStamp] and the 0 timevalue (= '01-01-1900'). You probably need to alter the WHERE clause, because I now only select the last three monts from now.

HanShi (7/15/2013)This code will give you the extra column with the first day of the month. I've calculated this with DATEADD combined with the DATEPART of [TimeStamp] and the 0 timevalue (= '01-01-1900'). You probably need to alter the WHERE clause, because I now only select the last three monts from now.