Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

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

    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
    "Heading for the deep end"

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: What's wrong with this expression?? (Acc 97 sr2 on 95b)

    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. <img src=/S/confused.gif border=0 alt=confused width=15 height=20>
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: What's wrong with this expression?? (Acc 97 sr2 on 95b)

    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
    "Heading for the deep end"

  4. #4
    Star Lounger
    Join Date
    Dec 2001
    Location
    Birmingham, Alabama USA
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: What's wrong with this expression?? (Acc 97 sr2 on 95b)

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

    RDH
    Ricky Hicks
    Microsoft MVP
    Birmingham, Alabama USA

  5. #5
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: What's wrong with this expression?? (Acc 97 sr2 on 95b)

    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. <Grin>

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

    Regards, Allan
    "Heading for the deep end"

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: What's wrong with this expression?? (Acc 97 sr2 on 95b)

    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. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Charlotte

Posting Permissions

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