Note that there are some explanatory texts on larger screens.

plurals
  1. POSQL-server syntax error when combining queries (pass-through query)
    primarykey
    data
    text
    <p>I'm trying to combine 2 queries to a sql-server pass-through query (PTQ). Both queries, when coded separately in Access, work. When combining these Access codes to one query, it still works in Access. But when I format the field names to T-sql, and try to run as a PTQ, I get a syntax error near "GROUP". When I delete this "GROUP BY" line, I get a syntax error near ";".</p> <pre><code>SELECT jaar, maand, wicode, pg_intern_code, pg_kriss_code, pg_kriss_naam, Count(pc0517.dbo.resul.klavnr) AS AantalVanKLAVNR FROM (SELECT Year(pc0517.dbo.resul.created) AS JAAR, Month(pc0517.dbo.resul.created) AS MAAND, pc0517.dbo.resul.wicode, dbo.tblproductgroep_intern.pg_intern_code, dbo.tblproductgroep_kriss.pg_kriss_code, dbo.tblproductgroep_kriss.pg_kriss_naam, pc0517.dbo.resul.klavnr FROM (dbo.tblproductgroep_kriss INNER JOIN (dbo.tblproductgroep_intern INNER JOIN dbo.tblrobbe_pg ON dbo.tblproductgroep_intern.pg_intern_id = dbo.tblrobbe_pg.pg_code_intern_id) ON dbo.tblproductgroep_kriss.pg_kriss_id = dbo.tblrobbe_pg.pg_code_kriss_id) INNER JOIN pc0517.dbo.resul ON dbo.tblrobbe_pg.robbe_pg_naam = pc0517.dbo.resul.prcode WHERE ( ( Year(pc0517.dbo.resul.created) = 2012 ) AND ( pc0517.dbo.resul.kanaal = "gg" ) )) GROUP BY jaar, maand, wicode, pg_intern_code, pg_kriss_code, pg_kriss_naam; </code></pre> <p>Other PTQ's on the same database (even combined with the PC0517 database), work without any glitch, but I'm totally new to SQL-server, so I don't know all the conventions yet, and am probably overlooking something basic...</p> <p>TIA</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload