You probably already noticed that you have posted in the Access Forum some code that is peculiar to Oracle dialect of SQL.
I think that the CASE expression is a "standard" SQL alternative to the DECODE function. It might look like this.
Code:
SUM (
CASE
WHEN DATEDIFF(day, date_sold, date_of_birth) BETWEEN 6570 AND 6935 THEN 1
ELSE 0
END
)
Well then there is the question, does Access provide CASE expressions. Probably does, but if not you can get the result with the IIf(condition, value_when_true, value_when_false) function. And the DATEDIFF function might have different values to specify the units for the difference between the dates.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.