I have a problem with subtracting two dates in the MySQL database and comparing them to int numbers. I tried to use dbfunctions.diffdays however it is a conflict of types.
When I start the application I get a message:
System.ArgumentException: 'DbArithmeticExpression arguments must have a numeric common type.'
Below is my code i
int intervalDay = 25;
var dateCount = (from Rezerwacje in db.Rezerwacje
join rooms in db.rooms on Rezerwacje.PokojID equals rooms.id
where (rooms.floor > 0 && rooms.floor <= 2) &&(Rezerwacje.DataDo == dateTime) && ((Rezerwacje.DataDo - Rezerwacje.DataOd).Days > intervalDay)
select Rezerwacje).Count();
return dateCount;