• 0

# The week for the month

## Question

Hi Guys,

Is there a way for me to know what week number does the selected date for the month?

Thanks for the help.

## Recommended Posts

• 0

Hi @FinTheHuman - you can use this formula to get the specific number of the week for the current month selected in your DATE field:

DatePart(day, DateDiff(day, 0, [@field:DATE])/7 * 7)/7 + 1

I hope this helps

~WatashiwaJin~

##### Share on other sites

• 0

Hi @FinTheHuman - In addition for the earlier response, you can also use this formula to get the week number with the corresponding month via DataPage level:

CASE
WHEN
(DatePart(day, DateDiff(day, 0, [@field:DATE])/7 * 7)/7 + 1) = 1
THEN 'Week 1 of ' + (DATENAME(month, [@field:DATE]))
WHEN
(DatePart(day, DateDiff(day, 0, [@field:DATE])/7 * 7)/7 + 1) = 2
THEN 'Week 2 of ' + (DATENAME(month, [@field:DATE]))
WHEN
(DatePart(day, DateDiff(day, 0, [@field:DATE])/7 * 7)/7 + 1) = 3
THEN 'Week 3 of ' + (DATENAME(month, [@field:DATE]))
WHEN
(DatePart(day, DateDiff(day, 0, [@field:DATE])/7 * 7)/7 + 1) = 4
THEN 'Week 4 of ' + (DATENAME(month, [@field:DATE]))
ELSE 'Week 5 of ' + (DATENAME(month, [@field:DATE]))
END

~WatashiwaJin~

• 0

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.