The error is that you did not specify the type of datetime (see below). In addition the format of date and time was not correct. Abother problem is that (DATETIME) should be the name of a table column and because DATETIME is a reserved word there cannot be a column named DATETIME, just replace (DATETIME) with the name of the column you want to examniate.
The current function uses the actual system time but if you prefer using the TACL statemente I am fine with that, just change it like this:
#APPEND l_in select
#APPEND l_in count(*)
#APPEND l_in FROM =TABLE where
#APPEND l_in (<column-name> < datetime "[year]-[month1]-[day1]-[hour]:[minute].[second].[micsec])" year to fraction
#APPEND l_in browse access;
But you should be careful, if your date and time field is not part of a key such a statement will very likely result in a table scan and depending on the size of the table that could last very long.