age_on_date | R Documentation |
Provides the sql code to compute the age of a person on a given date.
age_on_date(birth, reference_date, conn)
birth |
( |
reference_date |
( |
conn |
( |
SQL query that computes the age on the given date.
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))
DBI::dbDisconnect(conn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.