Some applications store dates as non-date values. For example, your application may store a date as an integer that looks like a date, such as 20101215 for December 15, 2010, or perhaps as the number of seconds after midnight. The problem is that doesn't make it very friendly to display to the user and makes it difficult to filter on a date range.

The solution is to convert the value to a true date value using an appropriate expression in the Output Expression of the field. The exact expression to use depends on what functions your database has and how the date is stored. For example, with Microsoft SQL Server or Pervasive storing dates as the number of days since January 1, 1900, use:

DATEADD(day, *fieldname*, '1900-01-01')

where fieldname is the name of the field. Be sure to turn off the Stonefield Query expression setting since this expression is evaluated by the database engine. Also, change the Output Type for the field to Date.

© Stonefield Software Inc., 2023 • Updated: 06/06/16
Comment or report problem with topic