SQL syntax problem........



I am using a fairly mundane SQL to get some records out of an access db
using D7/Win2K.
Two tables Invoice and InvoiceTotals get joined, wel, have a look

SELECT i.InvoiceID, sum(t.Amt) AS Amount
FROM Invoice i, InvTotals t
WHERE i.InvoiceID = t.MasterID
AND i.CustomerID = :AcctID
AND i.DueDate < :udt
AND i.DueDate > :ldt

Trying to open thius query throws a "missing operator" exception giving the
SQL statement as 'i.InvoiceID = t.MasterID AND...' i.e. everything after the
WHERE keyword. I'm kinda stumped. I thought it might be that this query
object had another query's linked datasource as its source for the AcctID
parameter. The parameters are all set up correctly as far as i can tell, but
the error msg shows the parameters replaced with garbage. And the other
query runs a similar SQL statement with no problem except it retrieves the
list of AcctID's that have Invoices in the date range.

I havent messed with Access that much nor ADO really but, I'm trying to
avoid the BDE on this one, can TADOQuery and family be as reliable as the
BDE components?

I rea;lize this is a pretty rundimentary SQL statement, but I have no idea
what is causing this. Could the table and db definitions have something to
do with it? Its not my design and has alot of that relationship stuff built
into it...

Anyway I certainly appreciate any help at all.

Thanks
Johnny McKeon


.



Relevant Pages

  • RE: I nees help with Sum/Count Query
    ... Open another query in design view and click on menu VIEW - SQL View. ... the SECOND SQL statement in the query. ... Invoice Data].Material, CountAS Invoices, ...
    (microsoft.public.access.gettingstarted)
  • Re: Insert, Delete, and Update - best practices advice please
    ... and handles only a small subset of the SQL keywords, functions, etc. ... The table GrowthInv is derrived from the above datasources by doing a SELECT ... those "fields" and represent the Invoice Number of an invoice and the ... as Customer Name and Salesperson but I can get those easily from Goldmine's ...
    (microsoft.public.sqlserver.programming)
  • Re: Insert, Delete, and Update - best practices advice please
    ... and handles only a small subset of the SQL keywords, functions, etc. ... The table GrowthInv is derrived from the above datasources by doing a SELECT ... those "fields" and represent the Invoice Number of an invoice and the ... as Customer Name and Salesperson but I can get those easily from Goldmine's ...
    (microsoft.public.sqlserver.programming)
  • RE: Form w/subform will not add new records?
    ... I assume that the main form is your Invoice form. ... Open the query in design view, click on menu VIEW - SQL ... The subform is detailed information about the purchased ...
    (microsoft.public.access.forms)
  • Re: Help with sql statment - ASAP please
    ... The form is not a sub form, ... the user enter the invoice number,InvoiceDate and company ... CTRL-G to Goto the debuG window -- look at the SQL statement ...
    (microsoft.public.access.formscoding)