Question
Permo Jacobs · Jan 17, 2018

How do i get the fist day of every month in objective scripting

 the start date must always
be the first day of the effective salary month.
 

00
3 0 5 564
Log in or sign up to continue

What do you mean?
If you have month and year just add 01 and produce the date.

Looks a bit baffling at first, but what a beauty in that expression!

Just a hint, I would take $ZD($h,2). For today, my development system (and systems at customers site) shows:

Write $horolog - $zdate($horolog, 4) + 1 --> 65925.93
Write $zdate($horolog,4) --> 20.07.2021
Write $horolog - $zdate($horolog, 2) + 1  --> 65926 // expected value

Later, this value (65925.93), as a $zdate() argument,  gives you an <ILLEGAL VALUE> 

For $zdate($horolog,4), the link you provided says:

4 DD/MM/[YY]YY (01/07/97 or 27/03/2002) — European numeric format. You must specify the correct dateseparator character (/ or .) for the current locale.

If you meant that you want to get the day (name/value) from the date then try $zdate(datevalue,dayformat) where datevalue is in $h format and dayformat is 10 for number of day in week, 11 for short day name, 12 for full day name.

check out the docs about $zdate , $zdateh, $systm.sql.datepart for more info about working with dates.