You said:

  select id, ProjID, PClass, PSubClass, bdate, lang, wDir
    From LSOpenJobs
   Where cust = 'PIPA'
     AND fromLang = 'EN-CA'
     AND (lang = 'DE-DE' OR lang = 'PT-BR')
     AND PSubClass LIKE '%-Trans'
      OR PSubClass Like '%-Valid'
     AND (PClass = 'Language' OR PClass = 'Technical')
     AND (bdate BETWEEN '2014-10-01' AND '2014-10-01')
GROUP BY id;

did you perchance mean:

  select id, ProjID, PClass, PSubClass, bdate, lang, wDir
    From LSOpenJobs
   Where cust = 'PIPA'
     AND fromLang = 'EN-CA'
     AND (lang = 'DE-DE' OR lang = 'PT-BR')
     AND (PSubClass LIKE '%-Trans' OR PSubClass Like '%-Valid')
     AND (PClass = 'Language' OR PClass = 'Technical')
     AND (bdate BETWEEN '2014-10-01' AND '2014-10-01')
GROUP BY id;

Although the parser does not care how you format your query, human readability 
is improved by using nice formatting.

>-----Original Message-----
>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
>boun...@sqlite.org] On Behalf Of jose isaias cabrera
>Sent: Thursday, 16 October, 2014 12:46
>To: General Discussion of SQLite Database
>Subject: [sqlite] Getting an unexpected result
>
>
>Greetings!
>
>I am trying to create a report with this query,
>
>select id, ProjID, PClass, PSubClass, bdate, lang, wDir
>From LSOpenJobs Where
>cust = 'PIPA' AND
>fromLang = 'EN-CA' AND
>(lang = 'DE-DE' OR lang = 'PT-BR') AND
>PSubClass LIKE '%-Trans' OR PSubClass Like '%-Valid' AND
>(PClass = 'Language' OR PClass = 'Technical') AND
>(bdate BETWEEN '2014-10-01' AND '2014-10-01')
>GROUP BY id;
>
>I am getting a bunch of records, where I should not get any.  Where is
>failing is the bdate.  All records are before the bdate.  Any thoughts on
>why?  Thanks.
>
>josé
>
>_______________________________________________
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to