P
PowerPoint Jedi
I designed the following query a couple weeks ago. It takes from an existing
table and creates another to my specified parameters. It works fine with no
problems when running it. Now I want to change it slightly but no matter
what I do when I go to save it it gives me a syntax error in from clause. I
have no idea why, even if i don't change anything it still gives me the error
but if I run it outright it still works. Below is the sql version of the
query and all the names used are correct. After I get the error message the
cursor is located on the fifth line right after the '(' it actually looks
like the parenthesis is highlighted. Anyone have any idea why I am getting
this. Thanks in advance.
SELECT * INTO [Year and monthly failures1]
FROM [SELECT
[all so raw].model,
[all so raw].PARTNO,
count( [all so raw].PARTNO) as Failures
FROM [all so raw]
WHERE ((([all so raw].YEAR)=6) AND (([all so raw].MONTH)<=9) AND (([all so
raw].PARTNO)<>"0000-00-0000-00") AND (([all so raw].CHGCDE)="1A" Or ([all so
raw].CHGCDE)="1G")) OR ((([all so raw].YEAR)=5) AND (([all so raw].MONTH)>9)
AND (([all so raw].PARTNO)<>"0000-00-0000-00") AND (([all so
raw].CHGCDE)="1A" Or ([all so raw].CHGCDE)="1G"))
group by
[all so raw].model,
[all so raw].PARTNO
order by
[all so raw].PARTNO
]. AS [year] LEFT JOIN [select
[all so raw].model,
[all so raw].PARTNO,
count( [all so raw].PARTNO) as Failures
FROM [all so raw]
WHERE ((([all so raw].YEAR)=5) AND (([all so raw].MONTH)=9) AND (([all so
raw].PARTNO)<>"0000-00-0000-00") AND (([all so raw].CHGCDE)="1A" Or ([all so
raw].CHGCDE)="1G"))
group by
[all so raw].model,
[all so raw].PARTNO
order by
[all so raw].PARTNO
]. AS [month] ON (year.model = month.model) AND (year.PARTNO = month.PARTNO)
ORDER BY year.model, year.PARTNO DESC;
table and creates another to my specified parameters. It works fine with no
problems when running it. Now I want to change it slightly but no matter
what I do when I go to save it it gives me a syntax error in from clause. I
have no idea why, even if i don't change anything it still gives me the error
but if I run it outright it still works. Below is the sql version of the
query and all the names used are correct. After I get the error message the
cursor is located on the fifth line right after the '(' it actually looks
like the parenthesis is highlighted. Anyone have any idea why I am getting
this. Thanks in advance.
SELECT * INTO [Year and monthly failures1]
FROM [SELECT
[all so raw].model,
[all so raw].PARTNO,
count( [all so raw].PARTNO) as Failures
FROM [all so raw]
WHERE ((([all so raw].YEAR)=6) AND (([all so raw].MONTH)<=9) AND (([all so
raw].PARTNO)<>"0000-00-0000-00") AND (([all so raw].CHGCDE)="1A" Or ([all so
raw].CHGCDE)="1G")) OR ((([all so raw].YEAR)=5) AND (([all so raw].MONTH)>9)
AND (([all so raw].PARTNO)<>"0000-00-0000-00") AND (([all so
raw].CHGCDE)="1A" Or ([all so raw].CHGCDE)="1G"))
group by
[all so raw].model,
[all so raw].PARTNO
order by
[all so raw].PARTNO
]. AS [year] LEFT JOIN [select
[all so raw].model,
[all so raw].PARTNO,
count( [all so raw].PARTNO) as Failures
FROM [all so raw]
WHERE ((([all so raw].YEAR)=5) AND (([all so raw].MONTH)=9) AND (([all so
raw].PARTNO)<>"0000-00-0000-00") AND (([all so raw].CHGCDE)="1A" Or ([all so
raw].CHGCDE)="1G"))
group by
[all so raw].model,
[all so raw].PARTNO
order by
[all so raw].PARTNO
]. AS [month] ON (year.model = month.model) AND (year.PARTNO = month.PARTNO)
ORDER BY year.model, year.PARTNO DESC;