Print Page | Close Window

"Starts with"

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14636
Printed Date: 02 May 2024 at 10:21pm


Topic: "Starts with"
Posted By: Jon K
Subject: "Starts with"
Date 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



Replies:
Posted By: DBlank
Date 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"


Posted By: Jon K
Date 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


Posted By: DBlank
Date 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 %



Print Page | Close Window