SQL syntax problem........
- From: "John McKeon" <johnnymckeon+@+earthlink.net>
- Date: Thu, 25 Aug 2005 01:54:03 GMT
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
.
- Follow-Ups:
- Re: SQL syntax problem........
- From: Riki Wiki
- Re: SQL syntax problem........
- Prev by Date: Re: Help Me..........
- Next by Date: Re: Filter error... but why?
- Previous by thread: Delphi 2005 dbGo with VCL.Net vs dbGo with VCL.Win32
- Next by thread: Re: SQL syntax problem........
- Index(es):
Relevant Pages
|