Function WEEK in Base

Does anyone know why the function WEEK returns a zero for Tuesday, Jan
1st, 2019? i.e. WEEK('19-01-01')

According to my calendar it should be week 1 and, in Calc, the WEEKNUM
and ISOWEEKNUM both return 1. (WEEKNUM starts the week on Sunday,
ISOWEEKNUM on Monday, but otherwise no difference)

Cheers
Harvey

Hi Harvey,

Does anyone know why the function WEEK returns a zero for Tuesday, Jan
1st, 2019? i.e. WEEK('19-01-01')

Must be WEEK('2019-01-01'), if you are using the internal HSQLDB. Gives
'1' here.
Must be EXTRACT(WEEK FROM CAST('2019-01-01' AS TIMESTAMP)), if you are
using internal Firebird. Also the result is '1' here.

According to my calendar it should be week 1 and, in Calc, the WEEKNUM
and ISOWEEKNUM both return 1. (WEEKNUM starts the week on Sunday,
ISOWEEKNUM on Monday, but otherwise no difference)

Regards

Robert

Hallo Robert,

I am using Mariadb10 as backend from a Base client via JDBC. I have
created the function within a Base Query (GUI).

Cheers
HArvey

...and by the way, it makes no difference whether 2019-01-01 or 19-01-
01 the result is the same

Hi Harvey,

I am using Mariadb10 as backend from a Base client via JDBC. I have
created the function within a Base Query (GUI).

So it isn't a LO-problem. WEEK gives (in MariaDB/MySQL) 0 - 53, if you
start the week with Sunday.
WEEK('2019-01-01',1) gives 1, because it returns values from 1 - 53.
See https://mariadb.com/kb/en/library/week/ for the right mode.

Regards

Robert

Terrific, Robert! That is what I needed to know!
Many thanks.

Harvey