Returning larger number - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Returning larger number

Last post 10-06-2010 11:01 PM by Jimmy. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 09-27-2010 03:41 PM

    Returning larger number

    Hi guys, This is probably an easy one, but does anyone know how to compare two numbers in text fields and return the larger one? Cheers
    Filed under:
  • 09-27-2010 10:12 PM In reply to

    Re: Returning larger number

    write simple rules on the two text boxes to compare the two and perform the action that you need to do. To be on safer side you can change the data type fo the text fields to "whole Number"

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 09-28-2010 03:07 AM In reply to

    Re: Returning larger number

    Thanks for that, can't believe I didn't think of that! I'm very new to InfoPath.. I have another question, do you know of a way to do a conditional concat? I want to concat "0" to the start of a number in a textfield if the number is less than 9. So I have a rule setup doing just that, but when I try to preview the form I get a message saying it's an infinite loop - do you know any way around this? Thank you so much for your help.
  • 10-06-2010 10:40 PM In reply to

    well the rule you have written is indeed an infinite loop because

    let us say the original value is 4, 4 is less than 9 so you put the new value as 04 but 04 is also less than 9, so you put the new value as 004.......

    a way around this would be to check the length of the field also. Check the attachment

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 10-06-2010 11:01 PM In reply to

    Re: Returning larger number

    For your first question, InfoPath provies a max() function, which should be the simplest way to do what you're asking.  Have you tried that?

    Here is a formula to conditionally append a leading zero to a single digit number:

     concat(substring('0', 1, 2 - string-length(number)), number)

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.