Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Technical Questions
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Technical Questions
Topic: Is not like query
Author
Message
adders
Groupie
Joined: 09 Aug 2010
Online Status: Offline
Posts: 53
Topic: Is not like query
Posted: 22 Sep 2011 at 10:33pm
I have around 300 part numbers I need to pull from a database, for example:
HIRK-433A
HIRK-433AQ1363
Is there away to not show parts with Q1363 or any Q number between 1 and 5000?
Also is there away of removing the decimal point when pulling out prices, in order to display in pence?
Thanks
Adam
IP Logged
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 23 Sep 2011 at 3:41am
1) in the filter expression, I would try
local numbervar ind := instr({table.field}, "Q", 4); //starts looking for Q after the 4th position (just in case)
local numbervar res;
if ind > 0 then (
res := cint(mid({table.field}, i + 1));
if res >= 1 and res <= 5000 then
false
else
true;
)
else
true
2) multiply the price by 100(or whatever valus is needed) in a formula and display the result
HTH
IP Logged
adders
Groupie
Joined: 09 Aug 2010
Online Status: Offline
Posts: 53
Posted: 26 Sep 2011 at 10:54pm
Hi Lockwelle,
Unfortunately it seems to ask for a string at cint.
Just trying some basic code, where {table.field} like %Q1% but that wont even bring up any parts for example 008-433FQ1847
Thanks
IP Logged
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 27 Sep 2011 at 12:12pm
the Mid() returns a string...you can also do totext({table.field},0,"") to turn your number into a string if that is needed.
LIKE in the formulas uses * and ? for the wildcards, not %
...you can also use instr() for like...if the value >0 then it is 'like', not quite as robust...
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
delete your posts in this forum
You
cannot
edit your posts in this forum
You
cannot
create polls in this forum
You
cannot
vote in polls in this forum
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
PRIVACY
|
CLICK PLAYS
|
BAEZL
© 2004-2026 Brian Bischof. All Rights Reserved.