Sep 30, 2009 #1 LinPro Programmer Jun 25, 2003 120 US Hi I am trying to fill in a field with repeating 0s? Is the a function in Crystal Report that can handle this? Lin
Hi I am trying to fill in a field with repeating 0s? Is the a function in Crystal Report that can handle this? Lin
Sep 30, 2009 #2 CoSpringsGuy IS-IT--Management Aug 9, 2007 955 US replicate string should do it {feild} = 500 replicatestring("0",8-len( totext( {feild} *100,"#") )) & totext( {feild} *100,"#") results in 00000500 I added the len function because typically when I need to do what your asking the reult has to be a certain length _____________________________________ Crystal Reports XI Developer Version Intersystems Cache 5.X ODBC connection Upvote 0 Downvote
replicate string should do it {feild} = 500 replicatestring("0",8-len( totext( {feild} *100,"#") )) & totext( {feild} *100,"#") results in 00000500 I added the len function because typically when I need to do what your asking the reult has to be a certain length _____________________________________ Crystal Reports XI Developer Version Intersystems Cache 5.X ODBC connection
Sep 30, 2009 #3 CoSpringsGuy IS-IT--Management Aug 9, 2007 955 US //{feild} = 500 replicatestring("0",8-len( totext( {feild} *100,"#") )) & totext( {feild} *100,"#") //results in 00000500 and yes i know I spelled field wrong _____________________________________ Crystal Reports XI Developer Version Intersystems Cache 5.X ODBC connection Upvote 0 Downvote
//{feild} = 500 replicatestring("0",8-len( totext( {feild} *100,"#") )) & totext( {feild} *100,"#") //results in 00000500 and yes i know I spelled field wrong _____________________________________ Crystal Reports XI Developer Version Intersystems Cache 5.X ODBC connection
Sep 30, 2009 Thread starter #4 LinPro Programmer Jun 25, 2003 120 US thanks.... I was looking for a built in function. Upvote 0 Downvote
Sep 30, 2009 #5 CoSpringsGuy IS-IT--Management Aug 9, 2007 955 US replicatestring is a built in function _____________________________________ Crystal Reports XI Developer Version Intersystems Cache 5.X ODBC connection Upvote 0 Downvote
replicatestring is a built in function _____________________________________ Crystal Reports XI Developer Version Intersystems Cache 5.X ODBC connection
Sep 30, 2009 #6 lbass Technical User Feb 9, 2002 32,816 US Depending upon what you are doing, you could potentially use the following: totext({table.number},"00000000") ...which would pad with leading zeros to create the length specified by the number of zeros (which you can adjust as necessary). -LB Upvote 0 Downvote
Depending upon what you are doing, you could potentially use the following: totext({table.number},"00000000") ...which would pad with leading zeros to create the length specified by the number of zeros (which you can adjust as necessary). -LB