Hi,
I have a table like (other properties removed for brevity):
Updates ( LastUpdated DateTime, UpdateEveryXMinutes int)
I'd like to get all rows that are ready for update, i.e.:
WHERE LastUpdated < DateTime.Now - UpdateEveryXMinutes
Currently, what I do is:
var dbDateAdd = new DbFunctionCall("DATEADD(minute, -UpdateEveryXMinutes, GETDATE())", new object[] { });
filter.PredicateExpression.AddWithAnd(UpdatesFields.LastUpdated < dbDateAdd);
What I would like to know is of a way to pass the column name as argument to the dateAdd, to avoid issues in using coplex query which includes column with the same name on another table.
Or, if you can suggest a different approach that would be fine as well. (btw, I don't care if DateTime.Now is taken on app server
or db server).
Using Sql Server 2016, LLBLGen 5.2, adapter.