Print Page | Close Window

Comparing Two Columns in a Table

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=701
Printed Date: 11-Jun-2026 at 7:46am


Topic: Comparing Two Columns in a Table
Posted By: cuneytgargin
Subject: Comparing Two Columns in a Table
Date Posted: 27-Feb-2008 at 4:28am
Hi.
I am trying to create Entityquery for the query below .


Select * From Personel Where StillWorking=1 and LastEntryDate > LastExitDate

As you see, I am trying to compare two columns of the table
and Entityquery I created is as below :


EntityQuery query = new EntityQuery(typeof(Personel), Personel.StillWorkingEntityColumn, EntityQueryOp.EQ, true);
            query.AddClause(Personel.LastEntryDateEntityColumn, EntityQueryOp.GT, Personel.LastExitDateEntityColumn);

and it's wrong..

Beacuse in fact query expression seems to  be like

Select * From Personel Where StillWorking=1 and LastEntryDate > Personel.LastExitDate

check the last query sentence, it sees it like Personel.LastExitDate column...

How can I ?

Cheers

Cuneyt Gargin - Trinoks



Print Page | Close Window