Also, hardcoding brackets like this... not a good idea in general.
Better to store this in a table to "Lookup", just in case you want/must change "31 - 65" to 2 different ones...
31 - 40
41 - 65 or something, having it in a table makes that much easier and doable on the fly instead of having to dig into code.
Also deviding goes before substracting in calculations....
Try
( dtmVisit - dtmDOB ) / 365.25
Better to store this in a table to "Lookup", just in case you want/must change "31 - 65" to 2 different ones...
31 - 40
41 - 65 or something, having it in a table makes that much easier and doable on the fly instead of having to dig into code.
Also deviding goes before substracting in calculations....
Try
( dtmVisit - dtmDOB ) / 365.25