Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lowercase on a parameter before reading records

Status
Not open for further replies.

mythprod

Technical User
Nov 6, 2008
4
US
I have a report that's having case issues with its data. I have a parameter that's dynamically pulling its data from a table in the database, this param is called ?files. The problem is, I need to convert this parameter to lowercase after the user has selected it so I can do a LowerCase(Table_Name.Files) and then in my select expert compare the two to see if they match. Right now if I do a straight LowerCase(Table_Name.Files) = {?Files} I only get part of the results as the database contains the same files (with paths) but in a different case.

For example, the user may choose this as a parameter:
c:\PathtoFiles\File.mpg

What the database contains is:
c:\PathtoFiles\File.mpg
C:\PathtoFiles\File.mpg
c:\PathtoFiles\File.mpg
C:\PathToFILES\File.mpg
c:\pathtofiles\file.mpg

I need that one parameter to be converted to lowercase, the database entries to be converted to lowercase and then do the comparison in the select expert so that all of the entries show up. Right now converted the table files to lowercase (as mentioned above) works fine but I'm having an issue getting the ?Files array converted to lowercase. A simple LowerCase({?Files}) won't work because ?Files is an array, so I'm guessing I need some sort of formula to do a For ... Do loop and assign a new array to := LowerCase({?Files}) I'm guessing.

Can anyone help?
 
Try:

numbervar i;
numbervar j := ubound({?Files});
stringvar x;

for i := 1 to j do(
if lcase({Table_Name.Files}) = lcase({?Files}) then
x := x + lcase({?Files})+","
);
lcase({Table_Name.Files}) in x

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top