Page 1 of 1
using substring function
Posted: Tue Aug 20, 2002 10:50 am
by a_rosenbaum_(Guest)
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.
=> RE: using substring function
Posted: Tue Aug 20, 2002 11:43 am
by Thomas_Freitas_(Guest)
substr(policy,1,1) would be the first position first character
==> RE: using substring function
Posted: Tue Aug 20, 2002 12:02 pm
by a_rosenbaum_(Guest)
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.
=> RE: using substring function
Posted: Tue Aug 20, 2002 12:21 pm
by Yves_(Guest)
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.
==> RE: RE: using substring function
Posted: Tue Aug 20, 2002 1:57 pm
by Thomas_Freitas_(Guest)
Are you sure that the first position is always upper case?
===> RE: RE: using substring function
Posted: Wed Aug 21, 2002 1:51 pm
by RomeztVeita
IT CAN BE A NUMBER OR A LETTER
====> RE: RE: using substring function
Posted: Wed Aug 21, 2002 4:35 pm
by freitas
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.