0
public class Service1 : IService1
{
    [OperationContract]
    public List<decmal> GetEnterCounts(DateTime StartTime, DateTime EndTime)
    {
        var db = new FACT_ENTER_EXIT();
        return (from e in **db.ENTER_CNT** where StartTime < db.DATE_ID && db.DATE_ID > EndTime select e).ToList();
    }
}

Ok, so I have this database FACT_ENTER_EXIT containing the field ENTER_CNT (nullable = false, type = decimal) which I want to return as a list

VS2010 spits out the following error at 'db.ENTER_CNT':

Error 1 Could not find an implementation of the query pattern for source type 'decimal'. 'Where' not found.

I must be missing something, could someone please point out where I'm going wrong??

Thanks in advance, Tom

1
  • You're defining a field on database-level? And then you're trying so select multiple values from that field? Something seems amiss. Commented Jun 18, 2010 at 8:54

1 Answer 1

2

You want to select from the table, not from a column, then select from your column.

Try:

from e in db.MyTable
where StartTime < e.DATE_ID && e.DATE_ID > EndTime
select e.ENTER_CNT

This resembles the following SQL:

SELECT e.ENTER_CNT
FROM MyTable e
WHERE @StartTime < e.DATE_ID AND e.DATE_ID > @EndTime
Sign up to request clarification or add additional context in comments.

1 Comment

Sorry, when I said database FACT_ENTER_EXIT, I meant table.. the FACT_ENTER_EXIT table comes from a data warehouse I am not trying to create any tables!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.