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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

define length of numeric result?

Status
Not open for further replies.

DanNorris2000

Technical User
Joined
Nov 10, 2000
Messages
186
Location
US
is there any way to define a maximum length for the following: int(Ledger.bookper/100)-1900) as bookyr
without converting to character? It currently defaults at Numeric 14,0 I would like it to be a length of 3 no decimals.
 
Dan,
It really depends on where you are using this code. If you are putting this value into a table of cursor, then just define the field N (3,0). In other places, you might get what you want by adding Mod(..., 1000) "around" your calculation. If this is part of a SQL SELECT, then you might want to try ... + 000. i.e.:
int(Ledger.bookper/100)-1900)+000 as bookyr

Rick

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top