Focal Point
using UPCASE

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3551018331

November 30, 2004, 12:35 PM
<ksarkar>
using UPCASE
Hello all,

I am using Developer Studio 5.0. I have a report that takes user input for Lastname and Firstname and returns the corresponding information from the database. This works fine but only if I use the same case as is in the database. e.g for input for Firstname 'Mark' returns the result correctly but not 'mark' or 'MARK'. I tried using UPCASE for the name but it says not a legal expression or type mismatch with output or 'value is missing for LEN'. This is my first report. Any suggestions?
One of the codes I tried is:
(UPCASE (256 , '&LNAME.Last name', 'A256' )))
OR (((UPCASE (256 , FIRST_NAME, 'A256' )) EQ (UPCASE (256 , &FNAME.First name, 'A256' ))))

where &LNAME and &FNAME are variable parameters.

Thanks!
November 30, 2004, 01:21 PM
reFOCUSing
Try this code. It will need to go before your where statement.

-SET &TEXTSIZE = 'A' | &LNAME.LENGTH;
-SET &LNAME = UPCASE(&LNAME.LENGTH,&LNAME,'&TEXTSIZE.EVAL');

-SET &TEXTSIZE = 'A' | &FNAME.LENGTH;
-SET &FNAME = UPCASE(&FNAME.LENGTH,&FNAME,'&TEXTSIZE.EVAL');
-RUN
November 30, 2004, 02:02 PM
<ksarkar>
Hello,

The code was cut off in the previous message. The code I tried is:

WHERE
((((UPCASE (256 , LAST_NAME, 'A256' )) EQ (UPCASE (256 , &LNAME.Last name, 'A256' )))
OR (((UPCASE (256 , FIRST_NAME, 'A256' )) EQ (UPCASE (256 , &FNAME.First name, 'A256' ))))


Thanks!
November 30, 2004, 02:46 PM
<ksarkar>
Thanks CurtisA,

I tried the code you sent. On Developer Studio, it wont even let me parse (which I have been facing throughout the process). I tried using your code in the HTML form I created from the report, but it gives a no HTML output page with the code being displayed.
i am not certain but maybe DS is not accepting the '.LENGTH' function. is there any command for finding the length of a string in DS? There is ARGLEN(len, data, output) buit that again asks for the length itself. Am a little lost here.

Any suggestions much needed Smiler

Thanks!
November 30, 2004, 03:43 PM
reFOCUSing
Can you create a fex with only the following code in it.

-SET &LNAME = 'uPpErCaSe';
-SET &TEXTSIZE = 'A' | &LNAME.LENGTH;
-SET &LNAME = UPCASE(&LNAME.LENGTH,&LNAME,'&TEXTSIZE.EVAL');
-TYPE This should output UPPPERCASE: &LNAME

This fex should output the following:
This should output UPPPERCASE: UPPERCASE

Then try a fex with the following code with your html page and see what happens:
-SET &TEXTSIZE = 'A' | &LNAME.LENGTH;
-SET &LNAME = UPCASE(&LNAME.LENGTH,&LNAME,'&TEXTSIZE.EVAL');
-TYPE LNAME: &LNAME
December 03, 2004, 01:21 PM
David Sibert
Curtis,

I have had the same problem in the past. Now I just use a Javascript to do it. In the below text I am changing the field to Caps if Characters or numeric 7 with leading zeros.

function fmtAcct(fld) {
var inStr=fld.value.toUpperCase().replace(/\s/g,'');
var tstNum=inStr.replace(/\D/g,'');
if (inStr == tstNum)
{
var padStr='0000000' + tstNum;
fld.value=padStr.substr(padStr.length - 7,7);
}
else
fld.value = inStr;

Good luck,

}
December 03, 2004, 01:24 PM
<ksarkar>
Curtis,

thanks, your suggestion works so I know that the UPCASE function is working. I still have to work it into teh rest of the code but this was a big help. thanks a ton!! Smiler
December 03, 2004, 01:25 PM
<ksarkar>
Curtis,

thanks, your suggestion works so I know that the UPCASE function is working. I still have to work it into the rest of the code but this was a big help. thanks a ton!! Smiler
December 03, 2004, 02:44 PM
susannah
the ARGLEN function tells you how long a text field is. no need to mess with .LENGTH