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

Test for Presence of Character/Substring

Status
Not open for further replies.

MikeCopeland

Programmer
May 21, 2007
91
US
Using CR XI...
Is there some way to test for the presence of a substring within a string? Specifically, I wish to look for data that isn't formatted correctly: e.g. the data is _supposed_ to be dollars.cents (nn.cc), but sometimes the data is inputted without the decimal point and cents.
For example, if the data is "7.00", it's okay; if it's "7", it's an error and I want to select that record for printing.
I can't seem to find any CR function that works like IsNull which does this, so I guess I'll have to build my own. I just don't see how to go about this... Any thoughts? TIA
 
is it always dollar.cents 00.00 then
may be you can use instr to see if it is if "." is existing
 
Why not change the data type at the database level?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
I don't have the luxury of being able to change the database - I don't even have update access to it. My tasks on this project merely involve producing reports, and however important they are (?) I can't recommend or implement any sort of database modification: it's managed by an application the people (I volunteer for) here, and any change(s) to it requires allocation and spending of funds (!). It's not an option...
Anyway, the "instr" does just what I need (but I couldn't find in intuitively in my manuals and references, so I had to ask the question here). Thanks to both of you for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top