Jump to content

Calculating Week from day and time


Aditya Singh 3

Recommended Posts

I have a date column with below values and want to get the week number

 

Date

 

 

 

 

 

1/1/2022 7:35:23 AM

 

 

 

 

 

 

 

1/2/2022 10:35:23 AM

 

 

1

 

 

 

 

1/3/2022 5:35:23 AM

 

 

1

 

 

 

 

1/4/2022 7:35:23 AM

 

 

1

 

 

 

 

1/5/2022 7:35:23 AM

 

 

1

 

 

 

 

1/6/2022 7:35:23 AM

 

 

1

 

 

 

 

1/7/2022 7:35:23 AM

 

 

1

 

 

 

 

1/8/2022 7:35:23 AM

 

 

1

 

 

 

 

1/9/2022 7:35:23 AM

 

 

1

 

 

 

 

1/10/2022 4:35:23 AM

 

 

2

 

 

 

 

1/10/2022 7:35:23 AM

 

 

2

 

 

 

 

1/11/2022 7:35:23 AM

 

 

2

Link to comment
Share on other sites

You can still use the week() function. The return of this function will depend on your regional setting. Therefore you have to add a time offset to your original column. The following calculation works for me. You might have to adjust it for your regional settings:

Week(DateAdd('hour', -5, [your.column])) - 1

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...