vba - SQL that access accepts, but SQL Server Express rejects -


today wrote bit of sql:

select count(t0021_werk_naam) (select distinct t0021_werk_naam,t0021_jaar,t0021_kwartiel     t0021_offertes     t0021_status_code = 'g' , t0021_jaar = 2013 , (t0021_kwartiel = 3)) 

this sql runs great when run locally in access, however, when run through code has been used ages , definetly not problem, , send sql express gives error says there's problem near ')'
after stripping away brackets possible becomes clear detects there's problem last ')' don't see problem.

any ideas?

you need give alias select in parenthesis:

select count(t0021_werk_naam)   (            select distinct t0021_werk_naam,                   t0021_jaar,                   t0021_kwartiel              t0021_offertes             t0021_status_code = 'g'                    , t0021_jaar = 2013                    , (t0021_kwartiel = 3)        ) t 

notice t in end after last parenthesis.


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -