JoeMiskey
asked on
Doing Greater Than or Equal to In LINQ
I am trying to create a LINQ expression in VB.NET. For some reason, I cannot get it to work.
Here are the references I have at the top of my class:
If I remove this last condition, or change the ">=" to "Equals", it does not return any syntax errors.
I have searched a lot of code examples on the web, and see lots of uses of "=", ">=", and "<=", but it seems I cannot use any of those. The only one it seems to like is "Equals".
Any idea why this is? Am I missing something?
Thanks
Here are the references I have at the top of my class:
Imports System.Data.SqlClient
Imports System.IO
Imports System.Text
Imports System.Linq
Here is the LINQ statement I have in one of my procedures: Dim results = From p In PreImportData.AsEnumerable
Join c In EnhancedACTRulesData
On p.Field(Of String)("GroupID") Equals c.Field(Of String)("GroupID") _
And p.Field(Of String)("SubGroupID") Equals c.Field(Of String)("SubGroupID") _
And p.Field(Of DateAndTime)("ServiceStartDate") >= c.Field(Of DateAndTime)("RuleStartDate")
Select p
It does not like the ">=" in my last condition.If I remove this last condition, or change the ">=" to "Equals", it does not return any syntax errors.
I have searched a lot of code examples on the web, and see lots of uses of "=", ">=", and "<=", but it seems I cannot use any of those. The only one it seems to like is "Equals".
Any idea why this is? Am I missing something?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I changed it to this, and it worked perfectly.
Open in new window
Thanks for finding my boneheaded error!