Version Info:
3.1 Final
Adapter .Net 4.0 C#
SQL Server 2008
I am having trouble figuring out how to do Date Math in LLBLGen.
Here is the SQL query that I am trying to achieve:
SELECT DISTINCT w.WaiverID
FROM Waiver w
JOIN WaiverWorkflowLog wwl ON w.WaiverID = wwl.WaiverID
JOIN WaiverWorkflowQueue wwq ON wwl.QueueID = wwq.QueueID
WHERE DATEADD(hh, wwq.WarningThreshold, wwl.AssignedDate) >= CURRENT_TIMESTAMP)
It is a simple enough query, but I am struggling with the LLBLGen syntax. The part I can't figure out is the DateAdd in the Where clause. Warning Threshold is the number of hours after a task is assigned that a warning email should be sent out. So I need to add the warning threshold to the assigned date and see if we need to send out the email.
Here is the C# code that I want (but this won't compile):
bucket.PredicateExpression.Add( WaiverWorkflowLogFields.AssignedDate.AddHours(WaiverWorkflowQueueFields.EscalationThreshold) >= executionTime);
How should I go about doing this?