Monday, August 16, 2010

How do I make an ASP page only show a figure to 2 decimal points when it gets info from MS Access DB?

The asp page gets its info from a Microsoft Access Database. The DB only shows 2 decimal points, and I want the ASP page to do the same.





Any ideas?





Thanks in advanceHow do I make an ASP page only show a figure to 2 decimal points when it gets info from MS Access DB?
Presumably, you are using a query to retrieve data from Access. Therefore, you could use the Format function in the query, something like this . . .





Select Table.fieldA, Table.fieldB, Format(Table.fieldC, ';00.00';) As Rate From Table;





The number of zeros AFTER the decimal point tells how many decimal places to display.


The number of zeros BEFORE the decimal point tells how many leading zeros to display.





Use the online help in Access to get a detailed description of the Format function.





搂How do I make an ASP page only show a figure to 2 decimal points when it gets info from MS Access DB?
I am just learning ASP a good site for information would be WWW.W3SCHOOLS.COM.





I have been living on this site for last couple of weeks.





Awsum site.

No comments:

Post a Comment