The code generated for the following is substantially less efficient than the code that just inlines CRT_DATE.
CREATE FUNCTION CRT_DATE(T TIMESTAMP) RETURNS DATE AS CAST(T AS DATE);
CREATE TABLE T(D DATE, X INT);
CREATE VIEW V AS SELECT * FROM T WHERE T.D < CRT_DATE(NOW())