Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

truncate number

Status
Not open for further replies.

atarrqis

IS-IT--Management
Nov 26, 2004
155
US
CR11 & Oracle
I have a number field, GL.yearmonth where the data looks like:
201101
201102, etc.
I have a paremter field - (?EndPeriod) where the user enters the ending yearmonth for the report.
I need to truncate this to just the first 4 digits and then compare it to a number field, GL.year, which is 4 digits and looks like:
2010
2011, etc.
I can't figure out how to truncate and make it still appear as a number field. If I use left('(?EndPeriod)', 4) Crystal treats it like a string.
 
tonumber(left(totext({?EndPeriod},0,""),4))

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top