Based on Gregorain calendar, every week of a year has a number from 1 to 52, 53 or 54. Use this tag for instance if you want to calculate the weeknumber from a certain date or vice versa. You also might include the date tag. This tag is independent of programming language.
Questions tagged [week-number]
603 questions
0
votes
1 answer
SQLite returns inappropriate week number
I am trying to get the ISO week number from the date in SQLite. When I try on few dates it gives the wrong week number.
For example:
SELECT STRFTIME('%W', '2018-12-31')
returns 53.
However, there was a solution that suggested the usage of the…

shashank s
- 1
- 2
0
votes
1 answer
R is not giving the correct week number
Hello I am trying to find the week number for a series of date over three years. However R is not giving the correct week number. I am generating a seq of dates from 2016-04-01 to 2019-03-30 and then I am trying to calculate week over three years…

Analytics_TM
- 493
- 6
- 28
0
votes
2 answers
Transforming dates: from year and week number into datetime
I am trying to transform the following dataframe
id year week
1 2018 43
1 2019 1
2 2019 4
3 2018 51
into a dataframe containing the following column
id year week year_week
1 2018 43 2018-43
1 2019 1 …

Lucas Dresl
- 1,150
- 1
- 10
- 19
0
votes
2 answers
DateAdd and DateDiff for Financial Week number and Year
I have seen and used various forms of DateAdd and DateDiff to strip time, get to the first day of any month or to move around a date.
I can see that when performing these calculation a pattern often used is as below:
select DATEADD(m,…

Unbound
- 177
- 2
- 14
0
votes
1 answer
Postgres dates and extracting week numbers - inconsistent results
I've been doing some statistics analysis of data in a Postgres (v10.6) database grouped by ISO week and have stumbled upon an apparent inconsistency in how week numbers are returned, for instance:
SELECT TO_CHAR(DATE_TRUNC('week',TIMESTAMP…

Almetraet
- 41
- 5
0
votes
0 answers
Calendar#getActualMaximum(Calendar.WEEK_OF_YEAR) in Java 8 (java.time package)
I'm actually looking for a solution to get the years week count in Java 8, using the java.time package.
With the old methods, it was simply calling:
Calendar#getActualMaximum(Calendar.WEEK_OF_YEAR)
But I cant find a similar solution for…

the_dani
- 2,466
- 2
- 20
- 46
0
votes
1 answer
Selecting custom start date of week
22nd Jan is the 3rd week of the year. My course started from 10th Jan, respect to that 22nd Jan should be the 2nd week. how can I find this using MySQL query and PHP?
I am using this WEEK(DATE_FORMAT(FROM_UNIXTIME(a.duedate), '%Y-%c-%d ')).

Sandipa Mukherjee
- 21
- 4
0
votes
1 answer
Count based on Week and Year for cells having Hyphens "-"
I have a tasks tracking sheet and want to count number of tasks received based on week number for a particular year. Thanks for the post COUNTIF date occurs in same week number and year
But still i have problem that i have dates in a column where…
0
votes
1 answer
How to get current week number for that year from a date in MySQL?
In MySQL,
SELECT WEEK('2019-01-07')
is showing week number 1.
But if I see, 2019 starts from Tuesday and current week for that date is week number 2.
How can I get the current week according to the year in this way?

lil-wolf
- 372
- 2
- 15
0
votes
1 answer
SSRS Returning incorrect WW
I have an SSRS report (2008R2 3.0) that uses parameter filters for workweek in the format YYYYWW. In 2018 there were 52 work weeks based on the ISO standard (source) .
For default parameter value I select the last WW using the following…

AJQShake
- 89
- 1
- 1
- 9
0
votes
2 answers
Pandas: Select highest day of the week, excluding weekends, unless one record
I've got a dataframe with dates, and I want to select the highest date in each week excluding weekends (so Fridays, if available), unless there is no Monday to Friday data and Saturday/Sunday are the only one's available.
The sample data can be…

aneroid
- 12,983
- 3
- 36
- 66
0
votes
1 answer
SQL - Select between current week number and three weeks behind
I'm not that good, when it comes to SQL. I'm trying to get data from the last three weeks. I can get the current week number, but really don't know how to subtract it so that it goes three weeks back and takes all data from that period.
This is my…

Lukas Méndez Duus
- 406
- 5
- 17
0
votes
3 answers
How to get a date by giving the week of the month and day of the week
How do i get a date by giving the week of the month and day of the week.
Example: If i need the third tuesday of November 2018.
Week of month : 3,
Day of Week : 3
Expected date is : Nov 20 2018
But the value we get is : Nov 13 2018. Since the…

Aju
- 796
- 3
- 10
- 29
0
votes
1 answer
filter data between 2 dates in excel using VBA
i was wondering if someone can help. i have tried some formulas but cant seem to work this out. i have a list of data with lots of dates some duplicate dates which are fine. i have data on a daily basis from 2015-2018. my aim is to try to put a…

Mujahid Khan
- 1
- 3
0
votes
2 answers
Custom Week number from Acquistion Date of each User
Is there a way to calculate Custom Week numbers that start from a user's first Transaction Date onwards? The Users (emailId) and TransDate columns may not be in a sorted condition as shown below:
e.g.
+------+-------------+---------------------+
|…

sifar
- 1,086
- 1
- 17
- 43