Offset syntax works incorrectly
See original GitHub issue*/10 * * * *
should be run at min 0th, 10th, 20th, 30th…
2-59/10 * * * *
should be run at 2nd, 12nd, 22nd, 32nd…
Currently, the 2 syntaxes above return the same result.
Should I need to put in any option to run correctly?
Issue Analytics
- State:
- Created a year ago
- Comments:12
Top Results From Across the Web
Incorrect syntax near OFFSET command - sql - Stack Overflow
My problem was that I was attempting to use OFFSET on a view, but wasn't joining.
Read more >Incorrect syntax near 'OFFSET'. - MSDN - Microsoft
hi all,. below is my query but, im getting error as "Incorrect syntax near 'OFFSET'. Incorrect syntax near '@P_Take'. " declare @ ...
Read more >SqlException: Incorrect syntax near 'OFFSET'. | Lendy's blog
Invalid usage of the option NEXT in the FETCH statement. Incorrect syntax near 'OFFSET'. The issue is caused by the fact that SQL...
Read more >OFFSET is bad for skipping previous rows - Use The Index, Luke
OFFSET doesn't deliver stable results and makes the query slow. Key-set pagination does neither.
Read more >Excel OFFSET function Explained in Simple Steps - XelPlus
To do that, you highlight the cells under the Sales column. However, the problem is that with a dynamic report such as this,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Actually, this is also wrong for days. A pattern like
0 0 */2 * *
will run on the 2nd, 4th, 6th … day of every month instead of 1st, 3rd, 5th … because for the date the*
expands to1-31
, thus*/2
should start at1
and progress in steps of2
@mooosh-milllie That’s exactly what the issue is about:
2-59/10 * * * *
should be equivalent to2,12,22,32,42,52 * * * *
but withnode-cron
it’s (wrongly) expanded to10,20,30,40,50 * * * *
Because the
10
in2-59/10
is not a divisor but a stepsize. Ie, the semantics of this expression is: start at minute2
and progress in steps of10
whereasnode-cron
implements the (wrong) logic, take all minutes in the range 2-59 which are divisible by 10 without remainder https://github.com/node-cron/node-cron/blob/a0be3f4a7a5419af109cecf4a41071ea559b9b3d/src/convert-expression/step-values-conversion.js#L19