I have a datagrid that displays an age (in years) based on a date of birth (mm/dd/yyyy). The following SQL is the data source for the grid. I want to truncate the Age field such that only the whole number appears, rather than a number with decimals. I tried using Format$ to format the result as "##" - but this rounded the age up or down, rather than giving the actual digits that the query returns.
Public Function ViewSQL(Sort As String) As String
ViewSQL = _
("Select PID, J_Number, " & _
"Juv_First & ' ' & Juv_Last As Name, DOB, " & _
"(DateDiff('m',DOB,Now)/12) As Age " & _
"From tblJuvenile Order by " & Sort)
End Function
Public Function ViewSQL(Sort As String) As String
ViewSQL = _
("Select PID, J_Number, " & _
"Juv_First & ' ' & Juv_Last As Name, DOB, " & _
"(DateDiff('m',DOB,Now)/12) As Age " & _
"From tblJuvenile Order by " & Sort)
End Function