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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query exits app??

Status
Not open for further replies.

rry2k

Programmer
Jun 28, 2001
678
US
I have a query that has a mind of it's own. Luckily I made a copy. The problem is: When I try to execute the query from a form or even in the database window all it does is exit the application. I can't even view it in design mode it does the same thing. I've included the code but it has absoulutely nothing to do with an exit.

SELECT DISTINCTROW [Time Card Hours].*, Projects.ProjectName, [Time Card Hours].[BillingRate]*[BillableHours] AS [Hourly Billings]
FROM Projects INNER JOIN ([Time Cards] INNER JOIN [Time Card Hours] ON [Time Cards].TimeCardID = [Time Card Hours].TimeCardID) ON Projects.ProjectID = [Time Card Hours].ProjectID
WHERE ((([Time Cards].TimeCardID)=[Forms]![TimeCardsNew]![TimeCardID]) AND ((DateDiff(&quot;y&quot;,[dateworked],Now()))<8));

Thanks..Russ
 
Without getting into the specifics, I would try the following:

1. Try to execute query on another PC.
2. Rebuild the query step by step. First drop the Where clause. Perhaps you have inadvertly created a cartesian join (many to many) relationship.
3. Compact the database to insure everything is in sync. You could have a damaged item within the database also.

htwh... Steve Medvid
&quot;IT Consultant & Web Master&quot;
 
Thanks Steve,

I created a query with out the where and it was fine. When I added it crashed. Given the fact that this query works in the old version I assume that something got damaged. I copied my revisions from the new version back into the old and now everything is smooth. Would a cartesion join possibly just run out of memory and exit?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top