Joined: 21 Jan 2013
Online Status: Offline
Posts: 1
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.
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
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.
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