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

Limit Size of Calculated Field

Status
Not open for further replies.

PGMR1998

MIS
Apr 10, 2001
29
US
I am creating a file from SQL code,and I am creating a new field in the file using the sum parameter. But the sum field size after I run the code is much larger than I need or want. How can I set its field size?
The resulting field is too large, about size of packed 30. I need only PACKED 10. I also do not need a packed field, but integer.
 
Use the CAST operator.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That worked! Thanks! Here is what I had to do to change the field from a PACKED 31 into a decimal 10.2 defined field:

CAST( sum(field name) AS decimal(10,2))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top