using substring function
-
- Posts: 26
- Joined: Tue Oct 10, 2017 12:44 pm
using substring function
I HAVE A DATABASE WITH POLICY NUMBERS AND PREMIUMS.__THE POLICIES ARE DIFFERENCIATED BY THE FIRST CHARCTER__I WANT TO CREATE A FIELD FOR THE PREMIUMS WHEN THE FIRST FIELD IS "G"__OR "S"____I CREATED A SUBSTRING FIELD FOR THE FIRST CHARACHTER AND NAMED IT POL_CD____I THEN CREATED A CALCULATED FIELD WHICH AS FOLLOWS IFF(POL_CD="G" OR POL_CD="Z",ANN_PREM,0)____WHEN I RAN THE REPORT ON GOT ZEROS REGARDLESS OF THE SUBSTRING CODE.____THANK YOU.
-
- Posts: 123
- Joined: Tue Oct 10, 2017 12:44 pm
=> RE: using substring function
substr(policy,1,1) would be the first position first character
-
- Posts: 26
- Joined: Tue Oct 10, 2017 12:44 pm
==> RE: using substring function
I USED THAT EXPRESSION AND IT GRABS THE FIRST CHARCHTER BUT WHEN I TRY TO CAPTURE THE PREMIUM IN THE SECOND CALCULATED FIELD I GET ZEROS______THIS IS PART OF A PREVIOUS REPORT WHICH I AM ADDING TO WHEN I SET IT UP ON A NEW BLANK REPORT IT WORKS.
-
- Posts: 14
- Joined: Tue Oct 10, 2017 12:44 pm
=> RE: using substring function
First, when I try something like that, I do some testing like printing the Pol_CD field to make sure I get the rigth value.____Just an idea.
-
- Posts: 123
- Joined: Tue Oct 10, 2017 12:44 pm
==> RE: RE: using substring function
Are you sure that the first position is always upper case?
-
- Posts: 0
- Joined: Wed Mar 28, 2018 10:49 am
====> RE: RE: using substring function
I would then do what the person above said. Put the calculated field in the report to see what the results are.____I assume you are converting the number to a character. If you are filtering for that calcualted substring, you should make sure that it is upper case only. ____It has to be in the substring results and I would venture to guess that you are looking for upper case when it is lower case or visa versa.