I have a db table that looks like this: State is a number that ranges from 1 to 6 and I’m storing the days on which the state changes.
| State | Date |
| 3 | 5/19/2012 |
| 1 | 6/12/2012 |
| 4 | 7/2/2012 |
I’m writing a .Where clause but I’m stuck. Basically, I’m query data for a certain date and one of the properties of the object model I want is the State on that certain date.
If I write:
from s in MyDC.StateTable
where s.Date == SomeDate.Date
select s.State
then of course it’s not going to return what I need. For instance, if I’m querying for 6/22/2012 then it should return 1 because that’s the state for that date; it was set to 1 on 6/12/2012. How do I write this where clause?
Thanks for your suggestions.
Perhaps something like: