October 6, 2005 at 9:55 am
Hi all,
Need to get this. Got the date and time for the column but want to select data in weekly format. how can i do that? Please let me know
Thanks
October 6, 2005 at 10:02 am
We need the DDL, sample date and sample results to answer this.
October 6, 2005 at 10:29 am
If you want to do some aggregation on your data, grouping it by weeks, you can get a function on the following site that will give you the start of the week then you can use that in your query:
http://www.sql-server-helper.com/functions/get-first-day-of-week.aspx
To use it in your query:
SELECT [dbo].[ufn_GetFirstDayOfWeek] (YourDateColumn), COUNT(*)
FROM YourTable
GROUP BY [dbo].[ufn_GetFirstDayOfWeek] (YourDateColumn)
Hope this helps.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply