Flylib.com

Books Software

 
 
 

create Number fields


create Number fields

Number fields are used to store numeric data: the digits 09, a decimal point, and a sign ( + or - ). You use a Number field when you want to be able to sort numerically (rather than alphabetically ), perform calculations on the field, or use the data in a Summary field (as the object of a summary calculation in a report, for example). The table below shows the names and descriptions of the Number fields you'll create for the Main layout.

Number Field Name

Description

Bond_Denomination

Savings bond's value at maturity

Bond_Interest

Interest to-date earned by the savings bond

Bond_Price

Original price paid for the savings bond

CD_Amount

Amount originally invested in the CD

CD_Rate

CD's annual interest rate

CD_Term

CD's investment period (in months)

Sav_Initial Balance

Starting balance for savings or money market account

Stk_Commission

Commission paid when buying the shares

Stk_Current Share Price

Current quote for the stock

Stk_Number of Shares

Number of shares purchased

Stk_Price Per Share

Share price when stock was purchased


In the Define Database dialog box (see page 10), enter Bond_Denomination in the Field Name box, select Number from the Type drop-down list, and click Create. Repeat this procedure to create the other Number fields in the table.



create Date fields

Date fields are used to record dates. Although you could use a Text field to store dates, only a Date field will sort dates properly, make them readily searchable, and enable you to easily use them in date-based calculations. The table below shows the names and descriptions of the Date fields you'll create for the Main layout.

Date Field Name

Description

Bond_Issue Date

Date on which the savings bond was purchased

CD_Maturation Date

Date on which the CD matures/ expires

CD_Purchase Date

Date on which the CD was purchased

Last Modified

Date on which the current record was created or last modified

Stk_New Date

Date of the most recent price update for the stock

Stk_Purchase Date

Date on which the stock was purchased


Create the Date fields as you did the Text and Number fields; that is, enter a field name, select Date as the field type, and click Create.



about calculations

FileMaker Pro supports two kinds of calculations: within individual records and across multiple records. Each is handled by a different field type.

Within-record calculations are accomplished using Calculation fields . A formula can combine other fields, constants, and built-in functions. For example, you could create a Calculation field that computes sales tax by multiplying an invoice total by a sales tax percentage ( Total * Tax Percent ) or by a constant ( Total * .075 ). The computed sales tax would be different for each invoice. Calculations can be performed on Number, Text, Date, Time, or Container fields; the specified result must also be one of these data types. If you change the data in any field on which a calculation is based, the result is automatically recalculated. Unlike other field types, the result in a Calculation field cannot be edited. (You can copy the result, but you can't change it.)

Calculations that are computed across all or a subset of records in the database are performed using Summary fields . Although Summary fields can be placed in data entry layouts, it's more common to use them in reports (as we'll do in the Investment Minder reports described in Chapters 6 and 7).

The table below shows the names and formulas for two Calculation fields you'll create for the Main layout. Additional Calculation fields will be defined later; their formulas rely on fields in related tables that we haven't created yet.

Calculation Field Name

Formula

Bond_Current Value

Bond_Price + Bond_Interest

Stk_Total Cost

(Stk_Number of Shares * Stk_Price Per Share)+ Stk_Commission


Note: An asterisk ( * ) in a formula means to multiply.