Results 1 to 5 of 5

Thread: CLOSED : function Max() problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2007
    Posts
    20

    CLOSED : function Max() problem

    Hi to all pros,

    I'm new in crystal report. I'm trying to do something like below in Selection Formulas-Record Selection :

    Code:
    {Table1.AUDIT_ID}= Max({Table2.AUDIT_ID}) and {Table1.ERROR_MESSAGE} like "*Validation*"
    but, i'm getting this error message "This formula cannot be used because it must be evaluated later"

    Also, how can i perform distinct query in crystal report. I cant find it.

    please help me if you know how to solve this. really appreciate it. thanks
    Last edited by 3nigm@; Dec 21st, 2007 at 04:04 AM.

  2. #2
    Hyperactive Member
    Join Date
    Aug 2004
    Location
    Bloomingdale, IL USA
    Posts
    284

    Re: function Max() problem

    I think instead of using
    {Table1.AUDIT_ID}= Max({Table2.AUDIT_ID})

    you need to use

    {Table1.AUDIT_ID}= (SELECT Max({Table2.AUDIT_ID}) from ... where...) and {Table1.ERROR_MESSAGE} like "*Validation*"

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2007
    Posts
    20

    Re: function Max() problem

    thx chrissy for your help....but i've found my way out

    THREAD CLOSED

  4. #4
    Lively Member
    Join Date
    Sep 2007
    Location
    Texas
    Posts
    98

    Re: function Max() problem

    Quote Originally Posted by 3nigm@
    thx chrissy for your help....but i've found my way out

    THREAD CLOSED
    Could you share the solution so the rest of us can learn from your experiance please?

    Thanks
    Working in VB2005 and SQL2005

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Oct 2007
    Posts
    20

    Re: CLOSED : function Max() problem

    my pleasure

    1. Just FYI, func Max() dont work in Selection Formula-Record Selection section, it works in other section such as Formula field

    2. Instead of doing distinct and Max() in the Record Selection section, i just put the query in the Add Command section.

    3. For those who dont know where to find the Add Command section, just open up the Database Expert, browse to your data source, instead of adding the tables to your report, pick the "Add Command" and there you go

Posting Permissions

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



Click Here to Expand Forum to Full Width