>Have you tried
>
>
>ldDate = DATE()
>lcSQL = "SELECT Numero FROM News WHERE StartDate=CTOD( '" + DTOC( ldDate) + "')"
>
>
>Its clunky though - with the CTOD in the expression that will get evaluated.
>
>We use Private variables to pass variables in our SQL expressions - something you probably don't want to do but...
>
>eg.
>
>PRIVATE pdDate
>pdDate = DATE()
>lcSQL = "SELECT Numero FROM News WHERE StartDate = ?pdDate"
>...pass SQL expression
>RELEASE pdDate
>
>
>and then have code to evaluate the variables prefixed with the question mark.
>
>again, it has its downsides with the variable being available in other methods and PRGs, but the lifetime of the variable is usually quite short - and if you have a standard naming convention for the Private vars then they shouldn't really clash with others.
Yes, as I mentioned, the goal is to have a static SQL and not dynamic. So, I need to make that SQL syntax to be available in other methods without having to create object properties or to pass method parameters.
Using a SQL where the WHERE clause would use CTOD() is not as optimizable as:
SELECT Numero FROM News WHERE StartDate={^2003/04/10}
which I updated after I created this thread. So, this is better than to have to CTOD() for every record it has to go through.