|
|||||||||
|
|
![]() |
|
|
|
![]() |
![]() |
|
Crystal Reports Tools: Improve Performance While Saving Time and Money |
|
Crystal Reports: CAST function to modify dataIn another article, we discussed how to use a UNION join to combine data from several tables.
The question now is when you get these data into your Crystal Report, what sort of field type appears in the "rectype" field. The default is that the field a 254 character string field. If you want a field of a different size or type you can use the CAST function. CAST has the syntax:
You could use it in the statement above to reduce the field to 8 chars with:
CAST supports SQL Server standard data types--so the field can be a small integer, string of fixed length, floating point or whatever other data format you require. One point to remember is to make sure that all the data values fit within the new data type. Don’t throw large values into a small integer field or you will overflow the field and cause an error.
This article is copyrighted by Crystalkeen, Mindconnection, and Chelsea Technologies Ltd. It may be freely copied and distributed as long as the original copyright is displayed and no modifications are made to this material. Extracts are permitted. The names Crystal Reports and Seagate Info are trademarks owned by Business Objects. |
These keywords may have brought you here: crystal reports cast function, changing field sizes, changing field types, crystal reports tutorials, crystal reports tips, crystal reports articles, crystal reports information, crystal reports tips, crystal reports help, crystal reports training
|