CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2014
    Posts
    9

    One Of Numeric Parameter?

    I would prefer to have parameter prompts for the end-user rather than they having to go into the Report Select Expert.

    However, I'm not sure how to do that for the One Of option?

    The user would like to copy and paste a long list of member numbers versus selecting them one by one which is the case with the parameter prompt since that seems to only work for the Equal To and the parameter field is set for Multiple. you can't copy and paste the member numbers you have to enter each one at a time.

    They want the ability to just simply copy and paste them.

    ClubMbrNo IN [910, 945, 958] versus
    ClubMbrNo = 910 then 945 then 958 <-- this takes too long.

  2. #2
    Join Date
    Aug 2007
    Posts
    179

    Re: One Of Numeric Parameter?

    If you have a string parameter named MyParameter, you can enter a comma separated list of numbers. Since the parameter is a string, you must convert your numeric field values to text to make the comparison. The ToText function, by default will format the numbers with decimal places and a thousand separator, which likely will not compare with what is entered into the parameter. So you must to also use format arguments with ToText.

    Code:
    ToText ({MyTable.ClubMbrNo},0,"") in {?My Parameter};

  3. #3
    Join Date
    Jun 2014
    Posts
    9

    Re: One Of Numeric Parameter?

    Quote Originally Posted by Ned Pepper View Post
    If you have a string parameter named MyParameter, you can enter a comma separated list of numbers. Since the parameter is a string, you must convert your numeric field values to text to make the comparison. The ToText function, by default will format the numbers with decimal places and a thousand separator, which likely will not compare with what is entered into the parameter. So you must to also use format arguments with ToText.

    Code:
    ToText ({MyTable.ClubMbrNo},0,"") in {?My Parameter};
    Interesting! I will try this. Thank you

  4. #4
    Join Date
    Jun 2014
    Posts
    9

    Re: One Of Numeric Parameter?

    Quote Originally Posted by Ned Pepper View Post
    If you have a string parameter named MyParameter, you can enter a comma separated list of numbers. Since the parameter is a string, you must convert your numeric field values to text to make the comparison. The ToText function, by default will format the numbers with decimal places and a thousand separator, which likely will not compare with what is entered into the parameter. So you must to also use format arguments with ToText.

    Code:
    ToText ({MyTable.ClubMbrNo},0,"") in {?My Parameter};
    Hi there, sorry for the delay!

    Ok, so I tried this but it is not producing results where there are results for the multiple ClubMbrNos.
    This is in the Report Select Export formula:
    Code:
    ToText ({v060ClubOfficersClubAddress.ClubMbrNo},0,"") in {?ClubMbrNo}
    The Parameter field is set to String as Type and Value Option set to Allow multiple values.
    So not sure where it's incorrect?

  5. #5
    Join Date
    Jun 2014
    Posts
    9

    Re: One Of Numeric Parameter?

    Name:  ToText.jpg
Views: 126
Size:  32.7 KB

    I changed the Parameter Field to Type: String
    then have this in Select Report Expert

    Code:
    ToText({v060ClubOfficersClubAddress.ClubMbrNo},0,"") IN {?ClubMbrNo}


    It's not working, anyone have a solution for this?
    Last edited by techsupport; November 30th, 2015 at 12:02 PM.

  6. #6
    Join Date
    Jun 2014
    Posts
    9

    Re: One Of Numeric Parameter?

    Anybody?

  7. #7
    Join Date
    Aug 2007
    Posts
    179

    Re: One Of Numeric Parameter?

    Hello - Difficult to trouble shoot your report here, but I would start by eliminating (comment out) any other parameters. I don't think you want to "Allow multiple values", as that turns your parameter into an array, which is not what you are looking for. You may have to experiment with some of the other setting available for parameters. You are trying to create a sql statement with a WHERE clause that looks like

    where table.field in ('123','456','789')

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

Featured