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

Error execuiting the command message

Status
Not open for further replies.

jcarmody

Programmer
Apr 25, 2002
39
US
Hello -

I am completely baffled by this, hope someone out there can help me. I have a database that has been around for a long, long time. Today I changed an existing query that drives a report, and one of the users (only one of them) can no longer get the report on her system. She receives the message, "There was an error execuiting the command". Not much to go on there. A couple of more details, my query change was to add criteria on 2 fields to limit to amounts > zero. This user is using the Access run-time and doesn't have Access. Any ideas? I included the SQL for the query in case someone sees a problem with what I've done.

Thank you -

Jcarmody

SELECT [Division Information].[Division Name], [Agent Master].[MGA Name], [Agent Master].[Agent Name], [Agent Master].[Agent Status 1], [Agent Master].[Agent MTD Annlzd Life], [Agent Master].[Agent MTD Annlzed Annu], [Agent Master].[Agent YTD Annlzed Life], [Agent Master].[Agent YTD Annlzed Annu], DatePart("m",[Commission Run Date]) AS monthno, [Agency Goal Table].*, [Misc Table].[Termination Date], [Agency Goal Table].[Monthly Life FYAC], [Agency Goal Table].[Monthly Annuity FYAC]
FROM (([Agent Master] INNER JOIN [Division Information] ON [Agent Master].[Agent Division] = [Division Information].[Division Code]) INNER JOIN [Agency Goal Table] ON [Agent Master].[MGA Name] = [Agency Goal Table].[Agency Name]) INNER JOIN [Misc Table] ON [Agency Goal Table].ID = [Misc Table].ID
WHERE ((([Misc Table].[Termination Date]) Is Null Or ([Misc Table].[Termination Date]) Is Null) AND (([Agency Goal Table].[Monthly Life FYAC])>0)) OR ((([Misc Table].[Termination Date]) Is Null Or ([Misc Table].[Termination Date]) Is Null) AND (([Agency Goal Table].[Monthly Annuity FYAC])>0));
 
You seem to have duplicated the clause

[Misc Table].[Termination Date]) Is Null

several times. Try this as your where clause

Code:
WHERE [Misc Table].[Termination Date]) Is Null 
AND [Agency Goal Table].[Monthly Life FYAC]>0 
AND [Agency Goal Table].[Monthly Annuity FYAC]>0;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top