Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004

    Unanswered: Using an SQL user-defined function in Crystal

    Hi All,

    I have several user-defined functions in my database and I want to use them in a report. I can't find how to do this - they don't appear in any of the lists of available fields?

    Any ideas?

    Thanks in advance...


  2. #2
    Join Date
    Feb 2004
    I'm not familiar with Crystal, but I'd created a Stored Procedure based on the function and bound it to Crystal Report
    MDB, ADP <-> MS SQL + VBA, ADO & RDO, .NET, Oracle, Java/Jsp.

  3. #3
    Join Date
    Oct 2003
    BA, Argentina

    Re: Using an SQL user-defined function in Crystal

    I used a stored function like this (i dont know if CR gives a better way):
    Create a new SQL Expression Field (for example, named fldUserName)with this text:


    (an example, getUserName is a function that returns a user name given an user code and today's date)
    Then, add the fldUserName field to the report. If you want to understand better, create the SQL expression field and view the SQL Query...

  4. #4
    Join Date
    Jun 2003
    Provided Answers: 1
    You can't reference SQL Server UDFs directly from Crystal Reports. Either recreate the logic with Crystal, or create a Stored procedure that returns the result of the function.

    As a rule of thumb, I push all processing onto SQL server and use Crystal only for displaying the results. Your Crystal report should call a stored procedure and display its output. Period. IMHO.
    If it's not practically useful, then it's practically useless.

    blindman "sqlblindman"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts