Hi,

I'm trying to use this expression in aggregate filter:

SyntaxEditor Code Snippet

DateTimeToDate(REGISTO_ENTRADAS.HORA_ENTRADA) = DateTimeToDate(CurrDateTime())

Where the arguments are in DataTime type and gives me this error:

What am I doing wrong?
Thank you.

Hi, 

Just out of curiosity, what is the data type of Hora_Entrada?

Cheers

Solution

By the way, if it is a DateTime (data type DateTime, not a text with the format of a date and time) then you can do this:

REGISTO_ENTRADAS.HORA_ENTRADA = CurrDateTime()

By the way, this will probably never end in a TRUE result..., as the CurrDateTime will be retrieved at the moment of the execution of this expression, using the current date and time of the server.

If you just want the DATE part then you can do this:

DateTimeToDate(REGISTO_ENTRADAS.HORA_ENTRADA) = CurrDate()

Cheers.

Solution

Eduardo Jauch wrote:

Hi, 

Just out of curiosity, what is the data type of Hora_Entrada?

Cheers

Hi,

It's DateTime.
Any solution for me?


If REGISTO_ENTRADAS.HORA_ENTRADA is a TEXT with a date & time in it, you need to do something like:

TextToDate(REGISTO_ENTRADAS.HORA_ENTRADA) = CurrDate()

But than you need to guarantee that the variable has the date & time in the correct format (defined in Service Center)

Cheers.

If it is REALLY a DateTime (DataType), please, put here the OML or an example reproducing the error so that we can take a look at it.

Cheers.

Eduardo Jauch wrote:

By the way, if it is a DateTime (data type DateTime, not a text with the format of a date and time) then you can do this:

REGISTO_ENTRADAS.HORA_ENTRADA = CurrDateTime()

By the way, this will probably never end in a TRUE result..., as the CurrDateTime will be retrieved at the moment of the execution of this expression, using the current date and time of the server.

If you just want the DATE part then you can do this:

DateTimeToDate(REGISTO_ENTRADAS.HORA_ENTRADA) = CurrDate()

Cheers.

Hi,

Thank you for your answer. Now both ways are working.


You're welcome :)