0

I am looking for a way to extract a week number based on this calendar: http://www.timeanddate.com/calendar/custom.html?year=2014&country=1&wno=1&holm=1&df=1

so eg a date of '2014-12-28 00:00:00.000' should give me week 1 and not 53 SELECT DATEPART (wk,'2014-12-28 00:00:00.000') gives 53

please note that this is not always the same as ISO WEEK

any idea?

Kris

mechanical_meat
  • 163,903
  • 24
  • 228
  • 223
Kris
  • 49
  • 7
  • 2
    What database are you using? The answer will likely depend on that. – mechanical_meat Mar 07 '16 at 16:50
  • What's "this calendar" about and how does it differ from ISO week? Please help with a better description. – Emacs User Mar 07 '16 at 16:51
  • the calendar that I am using is a US calendar the query below shows you an example select datepart(iso_week, '2013-12-29 00:00:00.000'), -- it gives you 52 datepart(week, '2013-12-29 00:00:00.000'),-- it gives you 53 1 as whatineed week number 1 comes from http://www.timeanddate.com/calendar/custom.html?year=2013&country=1&wno=1&holm=1&df=1 I am using SLQ SERVER 2012 – Kris Mar 07 '16 at 17:17
  • http://weeknumber.net/?q=2014-12-29 this is the logic that I need to incorporate in my code I would greatly appreciate some help :) – Kris Mar 07 '16 at 19:16

0 Answers0