Solved

Substitution Variable - what dictates the start of a week?

  • 25 November 2022
  • 6 replies
  • 64 views

Userlevel 4
Badge +8
  • Sidekick (Customer)
  • 53 replies

Hi all,

 

Some say the first day of the week is Sunday (Mainly in US & Canada), other say the first day of the week is Monday
 

So how is it defined in IFS, what the #First Day of Next Week# is?

icon

Best answer by anmise 25 November 2022, 13:13

View original

6 replies

Userlevel 7

In the database it’s calculated this way TRUNC(SYSDATE)-TO_NUMBER(TO_CHAR(SYSDATE, 'D'))+1+7, which gives Sunday. 

Userlevel 4
Badge +8

Thanks Anmise,

 

Is it possible to update this? Per ISO8601, first day is the week is Monday.

 

Arend

Userlevel 7

Thanks Anmise,

 

Is it possible to update this? Per ISO8601, first day is the week is Monday.

 

Arend

Where are you using it? In the client I believe it’s converted to match your browser locale e.g. if I’m searching with my browser set to Denmark, and I use #NEXT_WEEK# I will get 

(Created ge 2022-11-28T00:00:00Z and Created le 2022-12-04T23:59:59Z)

If I change it to US, then I get

(Created ge 2022-11-27T00:00:00Z and Created le 2022-12-03T23:59:59Z)

Userlevel 4
Badge +9

Thanks Anmise,

 

Is it possible to update this? Per ISO8601, first day is the week is Monday.

 

Arend

Where are you using it? In the client I believe it’s converted to match your browser locale e.g. if I’m searching with my browser set to Denmark, and I use #NEXT_WEEK# I will get 

(Created ge 2022-11-28T00:00:00Z and Created le 2022-12-04T23:59:59Z)

If I change it to US, then I get

(Created ge 2022-11-27T00:00:00Z and Created le 2022-12-03T23:59:59Z)

 

Didn't know so just tested by practical example 😉. You are correct! Also makes sense as they are Context variables so they take into account the….. context. 

 

 

 

Userlevel 7

Excellent news! So you are happy?

Userlevel 4
Badge +8

Thanks Anmise,

 

We are using this in the Scheduled Database task to run the Supplier Payment Proposals. Will play a bit further to see behaviour accordingly in regards to manual generating a Proposal, or a scheduled proposal.

Reply