tags:

views:

233

answers:

3

s it possible to do the following in subsonic.

SELECT * FROM TABLE1

WHERE Column1 > Column2 or Column1 < Colum3

All examples that I've seen assume you now a value to pass to the where clause. I'm trying to do this without creating a view.

Thanks

A: 

It appears this functionality is not in the current version but has been submitted into the code for the next release.

Dwight T
A: 

Yes it is.

Dim TableList As Generic.List(Of Database.Table1) = _
 New SubSonic.Select().From("Table1"). _
 Where("Col1").IsGreaterThan("Col2"). _
 Or("Col1").IsLessThan("Col3").ExecuteTypedList(Of Database.Table1)()
Rick Ratayczak
+1  A: 

If it's in our stack I can't find it :). It would be a good thing to add though :). You can, for now, use an Inline query to simply execute the statement you wrote (it takes straight SQL). I know it's fugly but...

Rick - if you did get that to work I'd be interested in how. "Col2" will try and be parsed to a type and your query will fail.

Rob Conery