Selection Formula

When I place the view selection formula below into my view, nothing appears.

SELECT s_sdate < “08/01/2004”

There are documents in the view that should appear from this formula; the field in the formula and the field in the column matches; the quotation marks do not make a difference; a semicolon at the end does not change anything; and yes, the field is a date/time type. Is there some setting in the view that may be wrong or something in the parent document I need to change?

Subject: Selection Formula

If your field is a date-time, then you’re comparing a date-time value to a text value. Try

SELECT s_sdate < @date(2004; 08; 01)

Subject: RE: Selection Formula

Thanks guys…both of them work.

Subject: Actually neither is ideal…

SELECT s_sdate < [08/01/2004]

This is the best way to express a date/time constant. The date is stored in a binary format that does not depend on the workstation or server’s date formatting.

Robert’s formula is a little inefficient because of unnecessary call to @Date.

Brian’s formula does not work in all cases. If you replicate the application to a server in Europe or Japan or the U.S. (whichever is not where your current server is), or a user with different date formatting settings creates a local replica.

Subject: Selection Formula

Try:tmp := @TextToTime(“08/01/2004”)

SELECT s_sdate < tmp