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 |
joey ascott
Starting Member
4 Posts |
Posted - 2007-08-02 : 09:08:57
|
I have a datetime field which I need to group by week (or even week number). I manipulate most data through Microsoft Excel, in which I can easily group dates as weeks through pivot tables, but not through the get external data function. Need to group badly!ANY IDEAS? |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-08-02 : 09:14:23
|
DATEPART(WEEK, Col1) E 12°55'05.25"N 56°04'39.16" |
 |
|
joey ascott
Starting Member
4 Posts |
Posted - 2010-12-10 : 09:25:12
|
Great thanks,Do you know how to set Monday as the first day of the week? |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-12-10 : 09:49:47
|
SELECT DATEDIFF(DAY, 0, Col1) / 7 AS WeekSequenceNumberFROM Table1 N 56°04'39.26"E 12°55'05.63" |
 |
|
joey ascott
Starting Member
4 Posts |
Posted - 2010-12-10 : 14:38:21
|
Thanks again,I'll give that a whirl |
 |
|
joey ascott
Starting Member
4 Posts |
Posted - 2010-12-12 : 01:42:38
|
Do you know how to convert the time element of a datetime field to a decimal?I would like to see'01/01/1900 04:45:59'as 4.75 |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-12-12 : 06:55:27
|
DATEPART(HOUR, Col1) + DATEPART(MINUTE, Col1) / 60E N 56°04'39.26"E 12°55'05.63" |
 |
|
|
|
|