Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 2024 
 
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!
 Administration Forums - Database Administration
Forum to discuss SQL Server or Oracle database administration related to SalesLogix databases. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Database Administration | New ThreadView:  Search:  
 Author  Thread: Storing data with trailing zeros in SQL Server 2000
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Storing data with trailing zeros in SQL Server 2000Your last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Storing data with trailing zeros in SQL Server 2000Your last visit to this thread was on 1/1/1970 12:00:00 AM
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?
[Reply][Quote]
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Re: Storing data with trailing zeros in SQL Server 2000Your last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Storing data with trailing zeros in SQL Server 2000Your last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/22/2024 3:30:18 PM