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: Error in Formula
Oldest Post First
Newest Post First
Author
Message
Lord Yorkshire
Newbie
Joined: 04 Jul 2010
Online Status: Offline
Posts: 28
Topic: Error in Formula
Posted: 07 Mar 2023 at 6:20am
I have a report that runs most of the time, but if i have a blank field it errors.
I am trying to pull a number out of a string but if there is no number, i get a non numeric error message.
How do i introduce a bit that says if there is no number after the “:” just put 1
tonumber(right({SfReport.Ta18},(len({SfReport.Ta18})- (Instr({SfReport.Ta18}, ":") ))))
The data looks like this
Sheet Size : 1200
Or
Sheet Size :
1st one is fine, 2nd one is where i get the error.
Edited by Lord Yorkshire - 07 Mar 2023 at 7:00am
IP Logged
Valert16
Groupie
Joined: 21 Mar 2016
Location: Spain
Online Status: Offline
Posts: 57
Posted: 08 Mar 2023 at 12:00am
Use this code (Crystal syntax):
If IsNumeric(Trim((split({SfReport.Ta18}, ":")[2]))) Then
ToNumber(split({SfReport.Ta18}, ":")[2])
Else
1
IP Logged
Lord Yorkshire
Newbie
Joined: 04 Jul 2010
Online Status: Offline
Posts: 28
Posted: 08 Mar 2023 at 1:27am
Thank you, that worked and now the report gives me the information exactly as i wanted.
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
This page was generated in 0.031 seconds.
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
CLICK PLAYS
|
COACH FORUMS
|
TROPICAL FISH
© 2004-2024 Brian Bischof. All Rights Reserved.