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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter Entering 3

Status
Not open for further replies.

rockman20

IS-IT--Management
Feb 2, 2004
34
0
0
US
Geesh I feel like pain here, but I have yet another question. (CR 8.5)

I am creating my reports using ODBC going to a SQL2000 server. This server houses all of the information I am creating my reports from. This is live data which is updated and maintained by a program that we use for our student information.

Since this is live data, I really can not "adjust" the data like I need to do in this case. Here is the problem.

I have a parameter set up which is tied to our student ID number. This allows the end user to run a report for any student they want. The problem is this. The setup for that particular field is a string and it is setup to be 12 characters long. However, all of our student ID's are only 5 characters in length. So what is happening is I am getting 7 spaces before the 5 digit number. So if someone keys in the 5 digit number, nothing shows up. But if you do 7 spaces and then the 5 characters, it comes up fine.

I thought about just adding the ID's into the selection list and then they can just chose the ID they want from the drop down. But I fear they might find this a bit bulky considering there will be over 11,000 ID's in this list.

So is there a way to either tell Crystal to ignore those 7 spaces at the beginning or automatically add those 7 spaces spaces into the selection box so that when a user just types in the 5 characters, it actually has 12 in there? Or does anyone have a better idea for me? Have I made my problem as clear as mud? (-:
 
Adjust your record selection formula (Database->Edit Selection Formula->Record):

ltrim({table.field}) = {?MyParameter}

-k
 
I tried to enter that in. This is what I have

ltrim{ASTU3014.PERMNUM} = {?PermNum}

Every time I try to save it though, it claims that the remaining text does not appear to be part of the formula.

I might be in the wrong area though. I could not find the DATABASE->EDIT SELEVTION FORMULA->RECORD. Instead I was right clicking on my {ASTU3014.PERMNUM} field in my report, choosing select expert, and then show formula.
 
If that's your actual record selection formula, then you're missing some parentheses:
Code:
ltrim[b][COLOR=red]([/color][/b]{ASTU3014.PERMNUM}[b][COLOR=red])[/color][/b] = {?PermNum}
-dave
 
That's because it should look like this
ltrim({ASTU3014.PERMNUM}) = {?PermNum}

the parentheses were missing.

good luck.
 
DUH!!!!!!!!!!!

Wow, can you tell it is Monday? Thanks to everyone that showed me the mistake I made!

Thanks again everyone!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top