using substring function

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
a_rosenbaum_(Guest)
Posts: 26
Joined: Tue Oct 10, 2017 12:44 pm

using substring function

Post by a_rosenbaum_(Guest) » Tue Aug 20, 2002 10:50 am

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.

Thomas_Freitas_(Guest)
Posts: 123
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: using substring function

Post by Thomas_Freitas_(Guest) » Tue Aug 20, 2002 11:43 am

substr(policy,1,1) would be the first position first character

a_rosenbaum_(Guest)
Posts: 26
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: using substring function

Post by a_rosenbaum_(Guest) » Tue Aug 20, 2002 12:02 pm

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.

Yves_(Guest)
Posts: 14
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: using substring function

Post by Yves_(Guest) » Tue Aug 20, 2002 12:21 pm

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.

Thomas_Freitas_(Guest)
Posts: 123
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: RE: using substring function

Post by Thomas_Freitas_(Guest) » Tue Aug 20, 2002 1:57 pm

Are you sure that the first position is always upper case?

RomeztVeita
Posts: 0
Joined: Wed Mar 28, 2018 10:49 am

===> RE: RE: using substring function

Post by RomeztVeita » Wed Aug 21, 2002 1:51 pm

IT CAN BE A NUMBER OR A LETTER

freitas
Posts: 68
Joined: Tue Oct 10, 2017 12:44 pm

====> RE: RE: using substring function

Post by freitas » Wed Aug 21, 2002 4:35 pm

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.

Post Reply