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!

CR9 doesn't see Access module in a query 4

Status
Not open for further replies.

SouthwestNut

Programmer
Sep 10, 2001
35
US
This might be more of a statment than a question. I have written a module that is referred to in my Access query

LastDayOfMonth(CInt(Right([01_qsub].[DATE-YYMM],2)))

The purpose of the module is to determine the last day of the month. When I run the query in Access it works fine. However when I run the same query as a record source for a Crystal Report I get the following error message:

Can't open recordset
Undefined function 'LastDayOfMonth'

 
Just use the query object in Access (rather than the query syntax as a Crystal Command) as the data source for Crystal. Queries in Access are treated just like tables from the point of view of Crystal.

- Ido

view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Sounds like it isn't supported, and the syntax looks wrong in Access to me.

You can always code the equivalent of the lastdayomonth function using standard Access functions or within Crystal.

The equivalent in Crystal is:

dateserial(year({table.date}),month({table.date})+1,1)-1

-k
 
Thanks synaps... I had actually discovered that work around for my particular issue, but I'm glad you posted it for future users.

Ido... I do refer back to the Access query and do not use the SQL query string. If I understand what your reply, I don't think it gets around the problem of where I can't refer to an access module inside a query's definition when that query is being used as a CR record source. But if I misunderstood, I would appreciate it if you might amplify on your work around.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top