This article describes how to apply specific formatting to data returned by a Microsoft FrontPage 2000 database connection. For example, data from a currency field may appear as "5" whereas you require "$5.00."
A variety of formats can be applied to database data by editing the SQL query that returns the data to the database region of your FrontPage web. The following example shows you how to apply a currency format to data from the Northwind sample database provided with Microsoft Access.
Apply the Currency Format to a Table Field
To apply a currency format to the Unit Price field of the Products table, follow these steps:
- Start Microsoft FrontPage 2000; on the File menu, point to New, click Web, click One Page Web, and then click OK.
- Right-click the Folder List column, click New Page on the shortcut menu, select Normal Page, and then click OK.
- On the Insert menu, point to Database, and then click Results.
- In step 1 of the Database Results Wizard, select Use a sample database connection (Northwind), and then click Next.
NOTE: If the Northwind sample database connection is not available, you need to create a connection to Northwind.mdb. For further assistance, refer to FrontPage Help as described in the "References" section. - In step 2 of the wizard, select Custom query, and then click Edit.
- In the Custom Query dialog, type the following SQL statement:
Select ProductID, ProductName, Format([UnitPrice], '$##00.00') As [Unit Price] From Products
Click OK to close the Custom Query dialog box, and then click Next. - In steps 3 and 4, click Next, and then in step 5, click Finish.
- On the File menu, click Save As, type Products in the File name box, and then click Save.
- Open another page in your web and create a hyperlink to Products.asp
- Click the Preview tab, and then click the new hyperlink to observe the formatted database data.