• What’s wrong with this expression?? (Acc 97 sr2 on 95b)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » What’s wrong with this expression?? (Acc 97 sr2 on 95b)

    Author
    Topic
    #363950

    This expression returns me a value of C00507 from the table
    what = DMax(“[AccNo]”, “Customer”)
    which is correct, but this:
    what = DMax(“[AccNo]”, “Customer”, “[AccNo] = ‘C?????'”)
    returns me a null.
    I want to use wild cards to find the largest value in the table starting with a C from a list field of values starting with either C or 65.

    How do I do it?

    Regards, Allan

    Viewing 0 reply threads
    Author
    Replies
    • #557107

      What you’re telling the system in the second expression is to return the DMax of the literal value ‘C?????’, not of any string that starts with a C as you apparently intended. Instead, try this:

      DMax(“[AcctNo]”,”Customer”,”[AcctNo] Like ‘C*'”)

      I’m not sure I understand the last part of your question. What do you mean values starting with either C or 65? You just said you wanted to return the largest value starting with a C. confused

      • #557111

        Thankyou Charlotte for your explanation of my problem.

        The C or 65 was meant to be added information, showing that the field in the table had values starting with either 65 or C. What I am trying to achieve is to find the highest value that starts with a C. Sorry if that wasn’t clear.

        Once again, I have learnt a little more of the intricacies of this amazing program!

        Regards, Allan

        • #557113

          Did the solution I gave in the other thread on this subject not give you the results you were after?

          RDH

          • #557362

            Ricky,

            The solution you gave me is fine and is the one I have implemented.

            My brain was working hard looking for alternative ways to achieve it while I was waiting for replies and I tried the above line of code and couldn’t work out why it didn’t work, so I posted the question.

            I now know how it should have gone and I consider myself well in front with a bit more knowledge under my belt.

            Sorry if you felt as if I’d gone elsewhere without coming back to you first.

            (Where are the codes for all the little emoticons??)

            Regards, Allan

            • #557402

              When you’re in the reply screen, look above the textbox and you’ll see a hyperlink marked “smilies”. That’s the panel with the various emoticons on it. grin

    Viewing 0 reply threads
    Reply To: What’s wrong with this expression?? (Acc 97 sr2 on 95b)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: