Processos no Microsoft 365 para configurar aplicativos do Office, resgatar chaves de produto e ativar licenças.
Olá Célio,
você pode criar no VBA a seguinte função:
Public Function dhAge1(dtmBD As Date, _
Optional dtmDate As Date = 0) As Integer
' From "Visual Basic Language Developer's Handbook"
' by Ken Getz and Mike Gilbert
' Copyright 2000; Sybex, Inc. All rights reserved.
' Thanks to Peter Mundy, on comp.databases.ms-access
' for fixing up a flaw in the original logic of this
' procedure.
' A shorter version of dhAge.
Dim intAge As Integer
If dtmDate = 0 Then
' Did the caller pass in a date? If not, use
' the current date.
dtmDate = Date
End If
intAge = DateDiff("yyyy", dtmBD, dtmDate)
dhAge1 = intAge + _
(dtmDate < DateAdd("yyyy", intAge, dtmBD))
End Function
Na sua consulta, você cria um campo assim:
Idade: dhAge1([Teu campo data nascimento])
Não é preciso ter na conulta um campo com a data atual.
Luiz Cláudio Cosenza Vieira da Rocha - http://msmvps.com/blogs/officedev - IT Lab www.itlab.com.br