Provides the sql code to compute the age of a person on a given date.
Examples
conn <- SCDB::get_connection(drv = RSQLite::SQLite())
dplyr::copy_to(conn, data.frame(birth = as.Date("2001-04-03"), "test_age")) |>
dplyr::mutate(age = !!age_on_date("birth", as.Date("2024-02-28"), conn))
#> Error in pkgdown::build_site_github_pages(new_process = FALSE, install = TRUE): (converted from warning) Age computation on SQLite is not precise. For some edge-cases, age will be off by 1 year! Consider using DuckDB as a local database with precise age computation.
DBI::dbDisconnect(conn)
