|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Returning numbers formatted as a percentI have a stored procedure that feeds a graph in an access ADP, and the
numbers are being sent as 0.883838..... can i format the number being returned from the stroed procedure to a percent? (ie 88.38%)? and also, how do i limit the number of decimal places? the columns being used in the calculations are of type decimal. thanks SELECT CONVERT(DECIMAL(5,2), 100.0*0.883838)
(You should add the % sign elsewhere, however, IMHO.) Show quote "Ben" <ben_1_ AT hotmail DOT com> wrote in message news:72D396F4-78AD-4AA5-932C-F998ECEB61D7@microsoft.com... >I have a stored procedure that feeds a graph in an access ADP, and the > numbers are being sent as 0.883838..... can i format the number being > returned from the stroed procedure to a percent? (ie 88.38%)? and also, > how > do i limit the number of decimal places? the columns being used in the > calculations are of type decimal. > > thanks > Ben,
If you are adding the % symbol via t-sql for ad-hoc reports, you could try: select convert(varchar(20),convert(decimal(8,2),column*100)) + '%' from table HTH Jerry Show quote "Ben" <ben_1_ AT hotmail DOT com> wrote in message news:72D396F4-78AD-4AA5-932C-F998ECEB61D7@microsoft.com... >I have a stored procedure that feeds a graph in an access ADP, and the > numbers are being sent as 0.883838..... can i format the number being > returned from the stroed procedure to a percent? (ie 88.38%)? and also, > how > do i limit the number of decimal places? the columns being used in the > calculations are of type decimal. > > thanks > Thank you both for your quick responses! I will give them a try as soon as I
can. thanks again! Show quote "Jerry Spivey" wrote: > Ben, > > If you are adding the % symbol via t-sql for ad-hoc reports, you could try: > > select convert(varchar(20),convert(decimal(8,2),column*100)) + '%' from > table > > HTH > > Jerry > > > "Ben" <ben_1_ AT hotmail DOT com> wrote in message > news:72D396F4-78AD-4AA5-932C-F998ECEB61D7@microsoft.com... > >I have a stored procedure that feeds a graph in an access ADP, and the > > numbers are being sent as 0.883838..... can i format the number being > > returned from the stroed procedure to a percent? (ie 88.38%)? and also, > > how > > do i limit the number of decimal places? the columns being used in the > > calculations are of type decimal. > > > > thanks > > > > > If you pre-format the column as a varchar with symbols, then whatever
application is consuming the rowset may have trouble summing, averaging, or applying their localized formatting. Show quote "Ben" <ben_1_ AT hotmail DOT com> wrote in message news:72D396F4-78AD-4AA5-932C-F998ECEB61D7@microsoft.com... >I have a stored procedure that feeds a graph in an access ADP, and the > numbers are being sent as 0.883838..... can i format the number being > returned from the stroed procedure to a percent? (ie 88.38%)? and also, > how > do i limit the number of decimal places? the columns being used in the > calculations are of type decimal. > > thanks > |
|||||||||||||||||||||||