Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: "Starts with" Post Reply Post New Topic
Author Message
Jon K
Newbie
Newbie
Avatar

Joined: 12 Aug 2009
Location: United States
Online Status: Offline
Posts: 8
Quote Jon K Replybullet Topic: "Starts with"
    Posted: 11 Oct 2011 at 4:48am
I need to suppress if an OrderID starts with a 9. I know the SQL but I can't figure out the Crystal syntax.

Any help is appreciated!

Jon
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Oct 2011 at 5:07am
is the orderid a numeric or text field?
if text
table.orderid startswith "9"
if numeric
totext(table.orderid) startswith "9"
IP IP Logged
Jon K
Newbie
Newbie
Avatar

Joined: 12 Aug 2009
Location: United States
Online Status: Offline
Posts: 8
Quote Jon K Replybullet Posted: 11 Oct 2011 at 8:52am
Hmm I can't get it to work.

I have this:
select * from customer_order where id like '9%'

and I get 34 records in SQL, but nothing in crystal when I use the syntax DBlank posted
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Oct 2011 at 8:59am

when you say "in Crystal" where are you using this?

in a command or in the select expert or somewhere else?
Note that that the LIKE function crystal uses * as the wildcard rather than % (sql).
so if you are using it in a formula or a select expert in crystal it has to be
table.id like '9*'
if you were writing a crystal command it still uses SQL so you woud stay with the %


Edited by DBlank - 11 Oct 2011 at 9:23am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.048 seconds.