Jump to content
  • 0

The week for the month


FinTheHuman

Question

6 answers to this question

Recommended Posts

  • 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~

Link to comment
Share on other sites

  • 0

Hi! adding these howto articles in case it might help you:

https://howto.caspio.com/datapages/reports/advanced-reporting/calculated-fields-and-datediff-function/

https://howto.caspio.com/function-reference/#:~:text=Date and Time Functions 

The second one states that DatePart(week, date), SysDateTime() and SysteUTCDateTime() functions will not work in the formula field.

Link to comment
Share on other sites

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

Loading...
×
×
  • Create New...