LinqConnect Professional Version 4.2.229 (18-Apr-2013) - incorrect SQL for SQLite

LinqConnect Professional Version 4.2.229 (18-Apr-2013) - incorrect SQL for SQLite

Postby AKRRKA » Fri 26 Apr 2013 09:15

I have a Linq query:

Code: Select all
from v in Values
where v.DT > DateTime.Parse("2013-04-10") &&
      v.DT < DateTime.Parse("2013-04-11")
select new
      {
        dt = v.DT.AddDays(+1),
        v.Val
      }


which will be generated SQL:
Code: Select all
SELECT datetime(t1.DT, '+1 day') AS C1, t1.Val AS Val
FROM "Values" t1
WHERE (t1.DT > :p0) AND (t1.DT < :p1)

If to use such query:
Code: Select all
from v in Values
where v.DT > DateTime.Parse("2013-04-10") &&
      v.DT < DateTime.Parse("2013-04-11")
select new
      {
        dt = v.DT.AddDays(-1),
        v.Val
      }

it will return incorrect SQL (datetime(t1.DT, '+-1 day') instead of datetime(t1.DT, '-1 day')):
Code: Select all
SELECT datetime(t1.DT, '+-1 day') AS C1, t1.Val AS Val
FROM "Values" t1
WHERE (t1.DT > :p0) AND (t1.DT < :p1)    
AKRRKA
 
Posts: 194
Joined: Thu 26 Jan 2012 15:07
Location: Russia

Re: LinqConnect Professional Version 4.2.229 (18-Apr-2013) - incorrect SQL for SQLite

Postby MariiaI » Fri 26 Apr 2013 11:14

Thank you for the report. We have reproduced this issue. We will inform you when it is fixed.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17


Return to LinqConnect (LINQ to SQL support)