1. John Raghanti
  2. PowerBuilder
  3. Friday, 6 September 2019 17:32 PM UTC

Hello! I'm on PB 2019, Build 2082 running SQL Server 2012. I've got a column that is numeric (8,3) for precision.

One of our users entered 11121256.333, which obviously causes an error when trying to insert it into the database.

My question is, how do I limit the user to 5 places before the decimal and 3 places after? I thought about a validation expression on the datawindow column, but not sure how I'd write it.

Any thoughts?

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 6 September 2019 18:29 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi John;

  Hopefully, your data entry for this is via a DataWindow or EditMask control. If so, just place an EditMask on the column (for a DWO) or control for something like:  "##,###,###.000". Then the DWO / control will hold the user to that limitation automatically.

HTH

Regards ... Chris

Comment
  1. John Raghanti
  2. Friday, 6 September 2019 18:35 PM UTC
Yes, this was perfect, thank you! I think my brain got stuck. :)
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 6 September 2019 18:44 PM UTC
Glad it worked John!

My suggestion for brain stickage is "More Coffee" (works for me - sometimes) - LOL!
  1. Helpful
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Friday, 6 September 2019 18:15 PM UTC
  2. PowerBuilder
  3. # 1

Hi  John,

Having no more than 5 leading digits means that the numeric value must be less than 100'000. So, something like:

dec(gettext())  > 0 and dec(gettext()) < 100000

HTH /Michael

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.