Joined: 29 Nov 2007
Location: United Kingdom
Online Status: Offline
Posts: 11
Topic: Trimming of number fields.. is that possible? Posted: 29 Nov 2007 at 4:59am
Hello.. my first ever post
I know CR allows you to trim string fields or either use the right/left function, however is there a similar function for number fields. I have a number field that always produce a space before the first digit and this is me being vain, I want to align the field with other fields for my form. Is there a way to omit that space or is that how Access is setted up?
Only been using CR for 3months and theres many more functions I have still yet to discover.
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 29 Nov 2007 at 12:15pm
I'm not familiar with the space being added at the front. Are you formatting it with a string function? Are you doing a left-justify on the field? Or are you simply dragging and dropping the numeric field onto the form? Not sure where the problem is being derived from.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
Joined: 29 Nov 2007
Location: United Kingdom
Online Status: Offline
Posts: 11
Posted: 01 Dec 2007 at 4:23am
When I drop the number field into the form and left align, there seem to be a space in front of the digits when view in design mode. Its a form designed for sales invoice, not a big problem but wanted it to align it with the other fields below it. Just wondering if ou can trim a number field from the front.
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 02 Dec 2007 at 12:34pm
Unfortunately, I can't mimic this behavior on my computer. However, if you want to experiment with it, here are some functions you can use.
CStr({field},"#") - convert a number to a string. Trim({string field}) - trims the spaces from both sides of a string.
If you check out my CR Encyclopedia book, Chapter 6 lists all the built-in CR functions and gives examples of how to use them. CR Encyclopedia
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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