Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter Query generates ODBC -- call failed error

Status
Not open for further replies.

sacsadmin

IS-IT--Management
Oct 16, 2002
39
US
Software:

Using Access 2000 on Windows 2000 service pack 3, running a System DSN to a Pervasive ODBC Client Interface.

The Access database is linking to tables in the Pervasive Server. I am trying to run a parameter query with the table tixhsthdr on the field ticketdate. The table requires the date be in YYYYDDMM format.

Query:

SELECT DISTINCTROW TixHistHdr.TicketDate, Items.ItemNumber, Items.Description1, Items.Description2, VendorItem.VendorItemNumber, Vendor.ApVendorNumber, Sum(TixHistLin.Quantity) AS [Sum Of Quantity], Sum(TixHistLin.ExtendedPrice) AS [Sum Of ExtendedPrice]
FROM (Items INNER JOIN (Vendor INNER JOIN VendorItem ON Vendor.Vendor = VendorItem.Vendor) ON Items.ItemNumber = VendorItem.ItemNumber) INNER JOIN (TixHistHdr INNER JOIN TixHistLin ON TixHistHdr.TicketNumber = TixHistLin.TicketNumber) ON Items.ItemNumber = TixHistLin.ItemNumber
GROUP BY TixHistHdr.TicketDate, Items.ItemNumber, Items.Description1, Items.Description2, VendorItem.VendorItemNumber, Vendor.ApVendorNumber
HAVING (((TixHistHdr.TicketDate) Between [Date1] And [Date2]) AND ((Vendor.ApVendorNumber)="PUM001"))
ORDER BY Items.ItemNumber;

If I run the query it will bring up the parameter boxes Date1 and Date2, but when I press OK to finish the query it gives me the error "ODBC -- call failed".

However, if I type out the between statement as follows:

Between "YYYYDDMM" And "YYYYDDMM"

The query returns the proper information.
I need to have the query prompt the user for the date range since this changes every week.

Your help is greatly appreciated.

 
When quering ODBC tables sometimes you need to limit your conditions - make the query a make table query - limit the conditions - you will have more records then you need - then query that table - you will no longer be connected to ODBC. -

ALSO...

This is important...

In the query...

Right click in the grey area where ther tables are...

In Properties - look for ODBC TimeOut

Change the 60 to 0

and SAVE imediately...

Victor...

VBELCORE@NYC.RR.COM
 
I am not having problems quering the database with the conditions. Like I stated earlier. If I type actual dates in the query statement rather than use the parameter fields, it will return the results.

When I replace the dates with parameter fields, this is when I get the ODBC error.

I changed the timeout rate to 0. This did not help.

Yes I agree with you that creating a make table query would help, but I have several years worth of data that I am querying against.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top