week-number Questions

0

I am working on a SaaS application that connects to a Microsoft SQL Server database, using T-SQL language. I cannot develop stored procedures, user-defined functions, or any database objects. I am ...
Rally asked 4/7 at 0:32

4

Solved

In Entity Framework 6 I can use SqlFunctions.DatePart() method: var byWeek = data.GroupBy(x => SqlFunctions.DatePart("week", x.Date)); But these classes (DbFunctions and SqlFunctions are not ...
Elderberry asked 8/3, 2017 at 15:20

20

Solved

I have an array of random dates (not coming from MySQL). I need to group them by the week as Week1, Week2, and so on upto Week5. What I have is this: $dates = array('2015-09-01','2015-09-05','20...
Asparagus asked 16/9, 2015 at 18:18

2

Solved

I'm not quite sure why my code gives 52 as the answer for: weekofyear("01/JAN/2017") . Does anyone have a possible explanation for this? Is there a better way to do this? from pyspark.sql imp...
Hildebrandt asked 18/4, 2018 at 16:22

3

Solved

I have a simple SQL for calculating week number in my reports on SQLite SELECT STRFTIME('%W', 'date_column') It was correct for 2009-2012. In 2013 I got always the wrong week number. For exampl...
Huoh asked 26/2, 2013 at 6:14

4

I can imagine table partition by a date (in particular for logs) is something widely used, but I am not able to find a good answer to my problem. I want to create a table partition by week (the nu...
Tsarina asked 17/4, 2013 at 0:20

19

Solved

I have a query that counts member's wedding dates in the database. SELECT SUM(NumberOfBrides) AS [Wedding Count] , DATEPART( wk, WeddingDate) AS [Week Number] , DATEPART( year, WeddingDate) AS ...
Roughshod asked 12/8, 2009 at 16:1

23

Solved

Does python offer a way to easily get the current week of the month (1:4) ?
Itch asked 27/9, 2010 at 17:57

6

Solved

For instance: Calendar c = Calendar.getInstance(); DateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); c.setTime( sdf.parse("31/12/2010")); out.println( c.get( Calendar.WEEK_OF_YEAR ) ); Print...
Overstuff asked 5/1, 2011 at 19:43

10

I need to get week number in php where week should be calculated from sunday. By default its from monday. Please help me to find a way how to get week number considering sunday as starting day. I...
Unread asked 17/4, 2013 at 9:56

5

Solved

I have a set of dates from which I must obtain the week of the month. There is a lot of literature on how to obtain the week of the year using VBA code but not the week number of the month. For i...
Marci asked 10/2, 2014 at 23:29

4

Solved

As the headline says, PHP's date("W") function gives back the calendar week (for the current day). Unfortunatly it gives back 52 or 53 for the first day(s) of most years. This is, in a simple think...
Custos asked 26/7, 2012 at 13:48

26

Solved

Anyone know an easy way to get the date of the first day in the week (monday here in Europe). I know the year and the week number? I'm going to do this in C#.
Daemon asked 19/3, 2009 at 14:15

5

Solved

Trying to code a correct function that returns the number of weeks in a given year, but without success. Example of the function I'm looking for : int weeks = GetWeeksInYear ( 2012 ) should r...
Bandore asked 30/6, 2013 at 13:55

4

Solved

How could I get from moment JS the week number from a date in the past only from a moment formatted object from a day selected?
Frottage asked 20/9, 2014 at 21:39

5

Solved

I have a dataset with a date column. I want to get the week number associated with each date. I know I can use: x['date'].isocalendar()[1] But it gives me the week num with start day = monday. Whi...
Swirl asked 23/3, 2020 at 15:19

3

Solved

We have WeekNo and Year entered into a table in following format: YYYY-ww (2021-48) I want start date and end date from given week no with year as above format. How to get it from SQL query or pro...
Removable asked 30/11, 2021 at 9:26

6

I am working on a project. There I should find the total weeks of a year. I tried with the following code, but I get the wrong answer: 2020 has 53 weeks, but this code gives 52 weeks. Where have I...
Sparoid asked 27/1, 2020 at 17:12

4

Solved

I'm in the middle of calculating week numbers for dates, but the System.Globalization.Calendar is returning odd results for (amongst other years) December 31st of year 2007 and 2012. Calendar cale...
Snazzy asked 10/1, 2012 at 18:56

3

Solved

I'm trying to make a calendar using wpf. By using itemsPanel and more, I have a grid with 7 columns(sunday-saturday) and 6 rows(week# of month). If i can find the starting position of the first of ...
Terrie asked 27/10, 2011 at 15:46

8

Looking for a function in R to convert dates into week numbers (of year) I went for week from package data.table. However, I observed some strange behaviour: > week("2014-03-16") # Sun, expecti...
Newhall asked 16/3, 2014 at 16:29

4

Solved

I only found a solution for Joda Time. My solution works only if the last day is not in the first week: LocalDate.now() // or any other LocalDate .withDayOfMonth(31) .withMonth(12) .get(weekFi...
Anurag asked 26/5, 2017 at 9:15

1

Solved

I am trying to get the week number from a date time and in my case, the first day of the week is Monday and I want to follow the FirstFourDays convention. To check the results, I am checking...
Paralyse asked 3/1, 2019 at 16:43

6

Solved

In regular SQL i could do something like SELECT * From T GROUP BY DATEPART(wk, T.Date) How can i do that in Linq to SQL ? The following don't work From F In DB.T Group R By DatePart(DateInter...
Vas asked 6/8, 2010 at 21:22

3

Solved

How do I get the maximum number of weeks for a particular year with Joda-Time?
Domination asked 8/6, 2011 at 18:54

© 2022 - 2024 — McMap. All rights reserved.