Cant using datetime in database query

Hello guys

I’m not able to use my datetime type variable in the query.

The variable ‘DateCurrent’ = DateTime.Now.ToString(“dd/MM/yyyy”)


Hi @Luca2

In order to use the DateTime variable in a query, you will need to convert it to a string in the appropriate format for the database you are querying. The format of the string will depend on the database you are using and the data type of the column you are querying.

@Luca2

First check the format of date in db and use the same here

cheers

“data_de_execucao” DATE NOT NULL

but what do i do now?
I don’t understand why RPA says there was a failure in the conversion to string if I already converted

“data_de_execucao” DATE NOT NULL

but what do i do now?
I don’t understand why RPA says there was a failure in the conversion to string if I already converted

@Luca2

The string output should match exactly with the format in db

If in db you have 12-12-2022 then you have to give the same

Cheers

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.