BootyBump
BootyBump

Reputation: 59

Problems with format box in access (to calculating age)

I have the formula:

=DateDiff("yyyy", [DOB], Now())+ Int( Format(now(), "mmdd") < Format( [DOB], "mmdd") )

for calculating age from the [DOB] field in Access

However, when I put this in the Format section on the table in Design view, on enter it changes the text to:

=d"ate"d"iff(yyyy, ["d"OB], "n\ow"())+ I"n"t( For"m"at("n\ow"(), mmdd) < For"m"at( ["d"OB], mmdd) )"

and tells me that it cannot find the field.

Can someone please tell me what is going on?

Upvotes: 0

Views: 78

Answers (2)

Ravi Yenugu
Ravi Yenugu

Reputation: 3898

Sorry to bring you the bad news but this cannot be achieved at least as a table column,

Also consider the following,

  1. Storing calculated fields in table is not recommended

  2. You would want to enter your formula in the Expression field in the Table design mode

  3. Given you are creating a new calculated field

  4. There are restrictions on which formulas can be used as calculated field, from what I have tried date() or now() cannot be used

Upvotes: 1

Kefash
Kefash

Reputation: 533

You cannot use that formula in table design. I would suggest using the form that is bound to the table field you wish to have the information.

Upvotes: 1

Related Questions