Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Left Formula Not Working Post Reply Post New Topic
Author Message
heawenly
Newbie
Newbie


Joined: 21 Jan 2013
Online Status: Offline
Posts: 1
Quote heawenly Replybullet Topic: Left Formula Not Working
    Posted: 21 Jan 2013 at 9:18pm
Left ({dataset.field}, {@totext})

{@totext} : val(dataset.field2) --> 9,0

v.s. 2005 asp.net crystal my project in , left formula I get an error in the length. Length part of the database. not convert integer. For example, 9,0 .. How do you transform integer type?
Not: Val(totext(field2,0)) I've tried did not.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 22 Jan 2013 at 7:11am
Try using ToNumber.  Something like this:
 
if not IsNull({dataset.field2}) then
  ToNumber(ToText({dataset.field2}, 9, 0)
 
Unless Dataset.Field2 is guaranteed to not be null in the database, you MUST check for null before trying to convert it.  If you don't, you'll get an error.
 
-Dell
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.032 seconds.