There are two datetime fields in my entity called dateStart and dateStartBill. I need an expression that returns true if the days are not equal. For example, if dateStart is 2026-06-01 and dateStartBill is 2026-06-02, the expression should return true. Here is what I have so far:
Unfortunately, that does not work because too many results appear that should not match the expression. Timezone awareness made the results better, but it is still incorrect:

This is the query I am trying to reproduce:
which works well:
Code:
OR:(
NOT_EQUAL:(
DAYOFWEEK:(TZ:(dateStart, "America/Denver")),
DAYOFWEEK:(TZ:(dateStartBill, "America/Denver"))
),
NOT_EQUAL:(
DAYOFWEEK:(TZ:(dateEnd, "America/Denver")),
DAYOFWEEK:(TZ:(dateEndBill, "America/Denver"))
)
)
This is the query I am trying to reproduce:
Code:
SELECT
id, date_start, date_start_bill, date_end, date_end_bill
FROM
session
WHERE (
DATE(CONVERT_TZ(date_start, 'UTC', 'America/Denver')) <>
DATE(CONVERT_TZ(date_start_bill, 'UTC', 'America/Denver'))
OR
DATE(CONVERT_TZ(date_end, 'UTC', 'America/Denver')) <>
DATE(CONVERT_TZ(date_end_bill, 'UTC', 'America/Denver'))
)
which works well:

Comment