A
Alison Downing via AccessMonster.com
Hi there,
I've read the Access help files on union queries and trawled the threads on
the forum but I'm still stuck and hoping someone can help me out. I've
used Access for several years to build small 'text based' DBs but this is
the first time I've really tried to do calculations and totals and this is
all very new to me so please be gentle.
I have two queries ([Invoices] and [Payments], both of which have
calculated fields ([Tax] and [Total] in [Invoices] and [Tax] and [Net] in
[Payments]. I am trying to build a union query which will pull together
the relavant fields from both queries so that I can set some date
parameters in another query and run a summary report.
However, I'm not getting very far as I keep getting an 'invalid SQL
statement' message and I don't understand what I am doing wrong. I am
trying to build the query in simple stages so that I can correct any errors
as I enter them.
What I have so far is;
SELECT [Date],[Net Price]
FROM [InvoiceNetForVATForm]
UNION SELECT [Date],[InvVATCalc]
FROM [InvoiceVATforVATForm]
UNION ALL;
I was expecting the query to return a list of all records on my DB (which
currently only holds about 20 test records) but when I click on 'view' I
get the message "Invalid SQL Statement; expected
'DELETE','INSERT','PROCEDURE','SELECT' or 'UPDATE'"
I'm using Access 2002 if that helps.
Hope someone can help me. Thanks.
Alison
amd[AT]dircon.co.uk
I've read the Access help files on union queries and trawled the threads on
the forum but I'm still stuck and hoping someone can help me out. I've
used Access for several years to build small 'text based' DBs but this is
the first time I've really tried to do calculations and totals and this is
all very new to me so please be gentle.
I have two queries ([Invoices] and [Payments], both of which have
calculated fields ([Tax] and [Total] in [Invoices] and [Tax] and [Net] in
[Payments]. I am trying to build a union query which will pull together
the relavant fields from both queries so that I can set some date
parameters in another query and run a summary report.
However, I'm not getting very far as I keep getting an 'invalid SQL
statement' message and I don't understand what I am doing wrong. I am
trying to build the query in simple stages so that I can correct any errors
as I enter them.
What I have so far is;
SELECT [Date],[Net Price]
FROM [InvoiceNetForVATForm]
UNION SELECT [Date],[InvVATCalc]
FROM [InvoiceVATforVATForm]
UNION ALL;
I was expecting the query to return a list of all records on my DB (which
currently only holds about 20 test records) but when I click on 'view' I
get the message "Invalid SQL Statement; expected
'DELETE','INSERT','PROCEDURE','SELECT' or 'UPDATE'"
I'm using Access 2002 if that helps.
Hope someone can help me. Thanks.
Alison
amd[AT]dircon.co.uk