Provides the sql code for a time interval (in years).
Examples
conn <- SCDB::get_connection(drv = RSQLite::SQLite())
dplyr::copy_to(conn, data.frame(birth = as.Date("2001-04-03"), "test_age")) |>
dplyr::mutate(first_birthday = !!add_years("birth", 1, conn))
#> Warning: Time computation on SQLite is not precise! For long time intervals, the result may be off by 1+ days. Consider using DuckDB as a local database with precise age computation.
#> Warning: Time computation on SQLite is not precise! For long time intervals, the result may be off by 1+ days. Consider using DuckDB as a local database with precise age computation.
#> Warning: Time computation on SQLite is not precise! For long time intervals, the result may be off by 1+ days. Consider using DuckDB as a local database with precise age computation.
#> # Source: SQL [1 x 3]
#> # Database: sqlite 3.47.1 [:memory:]
#> birth X.test_age. first_birthday
#> <dbl> <chr> <dbl>
#> 1 11415 test_age 11780
DBI::dbDisconnect(conn)