Well,
- the birth date field ([DOD]) and the [DayOfIntervention] are Date/Time
datatype
- I changed [DOD] to the name of my actual birth date field: the field's
name is "Data de Nascimento", and I tryed with [DatadeNascimento] and [Data
de Nascimento], but didn't worked
- I wrote all expressions in one single line
This is what I wrote ("Idade" is the name of the "Age" field,
"DatadeNascimento" is "DOB" and "Data" is the "DayOfIntervention"):
--------------------------
1 - In a Query:
Idade: DateDiff("yyyy", [DatadeNascimento], [Data]) - IIF(Format
([DatadeNascimento], "mmdd") Format([Data], "mmdd"), 1, 0)
or:
Idade: DateDiff("yyyy", [DatadeNascimento], [Data]) - IIF(Format
([DatadeNascimento], "mmdd") > Format([Data], "mmdd"), 1, 0)
- I wrote that as a SQL, in a single line, and didn't worked.
- I wrote that in a vacant Field cell in the query design grid
- Both situations showed the error message "Invalid SQL Instruction. DELETE,
INSERT, PROCEDURE, SELECT or UPDATE expected", and it selected the comma
after the "yyyy" (like if it was the responsible for the error)... and if I
delete the comma, it says "The expression you entered contains invalid
syntax. You may have entered an operand without an operator" and it selects
[DatadeNascimento]
----------------------------
2 - As the control source of an unbound control:
=DateDiff("yyyy",[DatadeNascimento],[Data])-IIf(Format([DatadeNascimento],"mmdd")>Format([Data],"mmdd"),1,0)
-Error message: "The expression you entered contains invalid syntax. You
omitted an operand or operator, you entered an invalid character or comma, or
you entered text without surrounding it in quotation marks"
Can you help me with this?...
Thanks