Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
As I know QV uses ISO format of weeks.
But now I have a problem that week(today()) returns 52, but it should be 51.
Of course I can add FirstWeekDay, BrokenWeeks, ReferenceDay. But that is not a solution.
Do you know why I have this strange behavior?
Thanks,
Tatiana
That's bad ... I'm just on QV 11 and there it worked like it should. What will be returned by weekstart(today()) ? For me it's a bug but maybe there is some quick workaround to correct the wrong result and therefore my suggestion with weekname().
If it's a critical calculation and a urge solution is needed I would probably use a (include)-variable with a manual correction so that it would be easy to change again if there is a bug-fix available.
- Marcus
Actually, I have a little bit different situation ) . The WeekName is correct here
The result of Week() function is affected by 3 environment variables: FirstWeekDay, BrokenWeeks and ReferenceDay, which are set in the beginning of a reload script.
In QV12 by default we have those variables in the beginning of a reload script.
In QV11 we don't have it.
So, make sure that you set FirstWeekDay = 0, BrokenWeeks = 0 and ReferenceDay = 4, to have ISO format
Hi,
tried similar method but it's not working for 2018 Week 1. can you check below thread and advise me. Thanks