Closed gksbr closed 2 years ago
Hello @gksbr ,
One way to work easily with datetime is surrounding them with #
.
So something like this:
WhereDynamic(x => "x.EndDate == #2022-01-01#")
Here is an online example: https://dotnetfiddle.net/21dOz9
// Date
Console.WriteLine(Eval.Execute("#2020-01-01#"));
// DateTime
Console.WriteLine(Eval.Execute("#2020-01-01 01:02:03#"));
// TimeSpan
Console.WriteLine(Eval.Execute("##01:02:03##"));
Let me know if that worked.
Best Regards,
Jon
Hello @JonathanMagnan,
It worked, thank you so much for the help
Hello,
Below code throws "No applicable member has been found for the expression" error.
WhereDynamic(x => "x.EndDate == 2022-01-01")
I tried various date and time formats but I couldn't figure it out.
If I try like this, it works, but I want to query with day, month and year.
WhereDynamic(x => "x.EndDate.Year == 2022")
Could you help me please?
Thank you.