gRegulator
Technical User
Hi,
I am trying to calculate the age that a client would be at the age of admission into our organization.
I know the current age would be found by:
(Date()-[Date of Birth])/365.25 AS [Age At Admission])
There are two ways by which a person may enter our organization, either Probation [Probation Start] or Conditional Sentence [CS Start]. So I know how to calculate the age when they enter for either one or the other, but i just dont know how to write it so that if the [Probation Start] is blank the age will be calculated from the [CS Start] and vice versa. Here is my current coding for the entire query:
So is there any way to write it so that instead of calculating the current age, or just from either the [CS Start] or [Prob Start] Fields.
I should also note that [Prob Start] will only have a value if Probation = True, [CS Start] will only have a value if Conditional Sentence = True.
I hope this makes sense. Thanks in advance!
I am trying to calculate the age that a client would be at the age of admission into our organization.
I know the current age would be found by:
(Date()-[Date of Birth])/365.25 AS [Age At Admission])
There are two ways by which a person may enter our organization, either Probation [Probation Start] or Conditional Sentence [CS Start]. So I know how to calculate the age when they enter for either one or the other, but i just dont know how to write it so that if the [Probation Start] is blank the age will be calculated from the [CS Start] and vice versa. Here is my current coding for the entire query:
Code:
SELECT tbl_offenders.[Offender #], tbl_offenders.[Given Names], tbl_offenders.Surname, (Date()-[Date of Birth])/365.25 AS [Age At Admission], AgeGp([Age At Admission]) AS [Age Group], tbl_offenders.Probation, tbl_offenders.[Community Service Order], tbl_offenders.[Conditional Sentence], tbl_offenders.[Fine Option Program], tbl_offenders.[CS Start], tbl_offenders.[Probation Start]
FROM tbl_offenders;
So is there any way to write it so that instead of calculating the current age, or just from either the [CS Start] or [Prob Start] Fields.
I should also note that [Prob Start] will only have a value if Probation = True, [CS Start] will only have a value if Conditional Sentence = True.
I hope this makes sense. Thanks in advance!