I have a field in the database that is in the following format: YYYYMM
Using procedure I can normally search these fields:
WHERE I.DT_INCL >= @inicio
AND I.DT_INCL <= @final
When I try to pass the query to linq it returns the following error: Operator '> =' can not be applied to operands of type 'string' and 'string'
(from incorporacao in Incorporacao.FoundEntities
where incorporacao.DataInclusao >= inicio && incorporacao.DataInclusao <= final
select incorporacao).ToList();
I came up with two possible solutions:
Create a method that returns a DateTime
by always setting the fixed day or leaving the field as an integer.
Which of these two solutions is the most correct in this context? The database is old and I can not modify it.