11/22/2024 7:51:13 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss SQL Server or Oracle database administration related to SalesLogix databases. View the code of conduct for posting guidelines.
|
|
|
|
Storing data with trailing zeros in SQL Server 2000
Posted: 04 Dec 06 8:43 AM
|
fiogf49gjkf0d I have a client on SLX 6.2 sp3 (soon to be 7). They have a custom screen that stores numbers with decimal values. They want the field on the front end to show two trailing zeros if the number doesn't have any decimal places - ex. 23 would be displayed as 23.00. Currently the field is a float datatype. I tried all the formatting choices on the front end with not luck.
Is it possible to store/display the number with two trailing zeros (currently saves with one trailing zero - 23.0) with out adding custom code each time I pull the number from the db?
Thanks Steve Knowles |
|
|
|
Re: Storing data with trailing zeros in SQL Server 2000
Posted: 04 Dec 06 11:23 AM
|
fiogf49gjkf0d Is this in a grid, or just on a form? If it is just displaying on a form then you could always just pull the value and use VBScript FormatNumber to format the display and then place in a label or something. Would that work? |
|
|
|
Re: Storing data with trailing zeros in SQL Server 2000
Posted: 04 Dec 06 11:31 AM
|
fiogf49gjkf0d That certainly would work - will need to call the code from several places (form, grids, mailmerge script etc.) as this field appears in more than one place. Just wanted to see if there where some kind of SQL trick or SLX front end formatting already in place. Not a big deal either way.
Steve K. |
|
|
|
Re: Storing data with trailing zeros in SQL Server 2000
Posted: 04 Dec 06 11:37 AM
|
fiogf49gjkf0d Ah, SQL tricks, I have plenty of those
select cast(MyTwoDigitDecimalField as decimal(10,2)) as MyTwoDigitDecimalField from tablename
That will do it for you. It should work fine via the SLX provider, although I've not tested that. |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|