Named Query with where clause of datetime not working properly

Sorry for the late reply,
I am using MySQL Workbench 8.0.33

For below issue I am trying to find a solution.

I was thinking of creating 2 tags for same variable, 1 for reading and 1 for writing and while saving the data in to the database I will have 2 tagID, for this reason I am trying to find a way like this.