deq()

Read(2614) Label: two date values, equal,

Description:

Compare the specified two dates.

Syntax:

deq(datetimeExp1,datetimeExp2)

Note:

The function compares two date parameters - dateExp1 and dateExp2 - to see if they are equal. By default, the result is accurate to day.

Parameter:

datetimeExp1/datetimeExp2

Date or standard datetime format string

such as yyyy-MM-dd HH:mm:ss, yyyy-MM-dd, or HH:mm:ss

Option:

@y

Accurate to the year

@q

Accurate to the quarter

@m

Accurate to the month

@t

Accurate to the ten-day period

@w

Accurate to the week; take Sunday as the first day of the week

@1

Work with @w option and take Mondy as the first day of the week; it is number 1 that is used in the option

Return value:

Boolean value

Example:

 

A

 

1

=deq("1988-12-08","1988-12-07")

false; judge whether two dates are equal.

2

=deq@y(date("1988-11-08"),date("1988-09-12"))

true; judge whether two dates belong to the same year.

3

=deq@m(date("1988-11-08"),date("1988-09-12"))

false; judge whether two dates belong to the same month.

4

=deq@q(date("1988-12-08"),date("1988-10-12"))

true; judge whether two dates belong to the same quarter.

5

=deq@t(date("1988-10-08"),date("1988-10-12"))

false; judge whether two dates belong to the same 10-day period of a month.

6

=deq@w(date("2023-09-03"),date("2023-09-09"))

true; take Sunday as the first day of a week and judge whether two dates belong to the same week.

7

=deq@1w(date("2023-09-03"),date("2023-09-09"))

false; take Monday as the first day of a week and judge whether two dates belong to the same week.