years_since

Years since given date (truncated)

years_since(date)

Parameters

Name Type Description
date field Date field to measure from, e.g. first_trade_date

Formula

years_since = EXTRACT(YEAR FROM AGE(scan_date, date))

Examples

// Stocks that started trading within the last year
years_since(first_trade_date) < 1;
// Stocks with at least 5 years of trading history
years_since(first_trade_date) >= 5;

Returns

int

See Also

days_since, weeks_since, months_since