Aug 24, 2007 #1 wrighterb Programmer Joined Feb 20, 2007 Messages 80 Location US Need to trim off the 0 in 09/17/07 but only if it is a zero Any Ideas, it will be happening in a loop. Thanks.
Need to trim off the 0 in 09/17/07 but only if it is a zero Any Ideas, it will be happening in a loop. Thanks.
Aug 24, 2007 #2 LyndonOHRC Programmer Joined Sep 8, 2005 Messages 603 Location US trim off the 0 in 09/17/07 " there are two zeros in your example. To remove leading zero only: Code: <cfset mdate='09/17/07'> <cfif left(mdate,1) eq '0'> <cfset mdate=mid(mdate,2,len(mdate)-1)> </cfif> To remove all zeros: Code: <cfset mdate='09/17/07'> <cfif find('0',mdate)> <cfset mdate=replace(mdate,'0','','ALL')> </cfif> Lyndon ---People Remember about 10% of what you say ---They never forget how you made them feel. Covey Upvote 0 Downvote
trim off the 0 in 09/17/07 " there are two zeros in your example. To remove leading zero only: Code: <cfset mdate='09/17/07'> <cfif left(mdate,1) eq '0'> <cfset mdate=mid(mdate,2,len(mdate)-1)> </cfif> To remove all zeros: Code: <cfset mdate='09/17/07'> <cfif find('0',mdate)> <cfset mdate=replace(mdate,'0','','ALL')> </cfif> Lyndon ---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
Aug 24, 2007 #3 cfStarlight Technical User Joined Mar 27, 2007 Messages 172 Location US If its a date/time value you could use dateFormat to skip the leading zero. #DateFormat(dateValue, "m/dd/yy")# Upvote 0 Downvote
If its a date/time value you could use dateFormat to skip the leading zero. #DateFormat(dateValue, "m/dd/yy")#
Aug 24, 2007 Thread starter #4 wrighterb Programmer Joined Feb 20, 2007 Messages 80 Location US Thank you very much! Upvote 0 Downvote