I get this error message:
Parse error: syntax error, unexpected '=' in C:\inetpub\wwwroot\abc\include\statistics-veh_settings.php on line 7
For this code:
SELECT CASE
WHEN idyear_veh < 10 THEN '1910s'
WHEN idyear_veh >= 10 AND idyear_veh < 20 THEN '1920s'
WHEN idyear_veh >= 20 AND idyear_veh < 30 THEN '1930s'
WHEN idyear_veh >= 30 AND idyear_veh < 40 THEN '1940s'
WHEN idyear_veh >= 40 AND idyear_veh < 50 THEN '1950s'
WHEN idyear_veh >= 50 AND idyear_veh < 60 THEN '1960s'
WHEN idyear_veh >= 60 AND idyear_veh < 70 THEN '1970s'
WHEN idyear_veh >= 70 AND idyear_veh < 80 THEN '1980s'
WHEN idyear_veh >= 80 AND idyear_veh < 90 THEN '1990s'
END AS Years,
count(*) AS VehicleCount
FROM reg_veh t1
LEFT JOIN vehyear_vyr t2 ON t1.idyear_veh=t2.id_vyr
LEFT JOIN vehmake_vmk t3 ON t1.idmake_veh=t3.id_vmk
LEFT JOIN vehmodel_mdl t4 ON t1.idmodel_veh=t4.id_mdl
LEFT JOIN vehstyle_vsl t5 ON t1.idstyle_veh=t5.id_vsl
LEFT JOIN members_mbr t6 ON t1.idmember_veh=t6.id_mbr
LEFT JOIN reg_met t7 ON t7.idmember_met=t6.id_mbr
WHERE t1.idmodel_veh IS NOT NULL
AND t1.idstyle_veh IS NOT NULL
AND t7.active_met=1
GROUP BY Years
ORDER BY Years
NOTE: The Query works good in preview.
ANY SUGGESTIONS? Thanks in advance.