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

Want to generate an error with the Query object - Using Events

Status
Not open for further replies.

bessebo

IS-IT--Management
Jan 19, 2001
766
US
I am still trying to figure out the best way to only kick off a report when there is data to report and I think the best way to do this is with Events. I would like to create a query using INFO SQL Designer that will tell me if there is a check processed on that day in our database. If so, I want to schedule a report to run which will send the report of the check created in an email to an individual.
I have found a Crystal Care Technical Support KnowledgeBase Article c2001299 on this and it will work BUT I do not know how I can make the query fail if there is no data to report. Is there a way to do this within SQL then I can use an If Exists (query showing if there were checks cut) Else 'Generate and error.

Any help would be appreciated..

Regards,
Bob
 
Hi,

I have been testing this procedure.

@Formula - put in the report footer.
If {?InputAmountFromMainFrame} = Sum ({contract_pay_amt}) then
today //no action
Else
CDate({security_agency}) // this is our failure...

-- Security_agency is a 3 char string and cannot be a date.


An E-mail notifies me if the report generates a contract_pay_amt that is not equal to my input amount.

Also I have found that you have to publish in a different format than rpt (testing with Excel).

Hope this helps.

Mark

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top