-
-
Notifications
You must be signed in to change notification settings - Fork 519
Open
Labels
Description
Hello. SqlKata already have WhereDatePart method, but it doesn't have something like WhereDateTrunc method to compare truncated dates. For example we need to check if Date is current month:
query.WhereDateTrunc("month", "Date", "=", DateTimeOffset.UtcNow);and sql for this operation will be like this:
SQL Server
dateadd(MONTH, datediff(MONTH, 0, [Date]), 0) = dateadd(MONTH, datediff(MONTH, 0, @p0), 0) Postgres
date_trunc('month', "Date") = date_trunc('month', @p0)Oracle also has trunc function, MySql can use DATE_FORMAT.
It would be nice to have such feature.