... and to resolve this you'll need to first get month(startweekdate) and join that back to the rest of the result set. I don't see any ways to do it in 1 go.
Thanks mister. A route I had debated; however not really looking to take that avenue at this time. I'm still working on being able to do within my query without the need of the infamous calendar table.
Here... you'll have to get the right holidays for your country(ies) but the rest of it is done.
Adam Bean (5/18/2011)
Thanks mister. A route I had debated; however not really looking to take that avenue at this time. I'm still working on being able to do within my query without the need of the infamous calendar table.
I can't understand why you would avoid this?
You will need to work out the week start date for every date, then get the month and year for that week start date.
You might find that you come back to a "calendar" table - they are very useful!
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
Ninja's_RGR'us (5/18/2011)
Here... you'll have to get the right holidays for your country(ies) but the rest of it is done.
I'll have one of those, thanks a lot Ninj
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
mister.magoo (5/18/2011)
Ninja's_RGR'us (5/18/2011)
Here... you'll have to get the right holidays for your country(ies) but the rest of it is done.I'll have one of those, thanks a lot Ninj
HTH, I'm just sad I lost the script that created those! Good thing I won't need it for another couple decades!
Here's a Calendar Table Generator that I put together; it features all US National Holidays, as well some other that were fun to research and code; if the holiday is shared by others, the results are comma delimited,like "Guy Fawkes Day,Election Day" or "Thanksgiving Day,Hannukkah/Chanukah"
Lowell
Viewing 11 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply