I am trying to create a constraint on a date of birth field.
If a student was registering for a driver licence, and they must be (say) 16 years old, but entered a DOB that was short of the required 16 years,how can this be flagged to show not valid?
Thanks
Date of birth checker
Date of birth checker
LibreOffice 5.1.3.2 on Windows 8
Re: Date of birth checker
[quote=""Rakau"]I am trying to create a constraint on a date of birth field.
If a student was registering for a driver licence, and they must be (say) 16 years old, but entered a DOB that was short of the required 16 years,how can this be flagged to show not valid?[/quote]
Yes. The answer in the post below ( look at the posts by both Sliderule and Villeroy ) , assumes with your use of LibreOffice Base as your database back-end, and, HSQL Embedded Database as your database back-end, that is HSQL 1.8.0.10 ( you can confirm this be looking that the Status Bar at the bottom after starting your Base File ( *.odb ) ).
viewtopic.php?f=13&t=36069&p=165388
Explanation:
Sliderule
If a student was registering for a driver licence, and they must be (say) 16 years old, but entered a DOB that was short of the required 16 years,how can this be flagged to show not valid?[/quote]
Yes. The answer in the post below ( look at the posts by both Sliderule and Villeroy ) , assumes with your use of LibreOffice Base as your database back-end, and, HSQL Embedded Database as your database back-end, that is HSQL 1.8.0.10 ( you can confirm this be looking that the Status Bar at the bottom after starting your Base File ( *.odb ) ).
viewtopic.php?f=13&t=36069&p=165388
Explanation:
- By performing the calculation as noted in the link above, you can determine the AGE in years. This calculation can be also be used, for example:
Code: Select all
CASEWHEN(calculation >= 16,'Valid','Not Valid') as "Age_At_Least_16"
Code: Select all
CASE WHEN calculation >= 16 THEN 'Valid' Else 'Not Valid' End as "Age_At_Least_16"
- If you are using HSQL 2.X, or, another database back-end, let us know, since that SQL calculation might be different.
Sliderule