LispWorks User Guide and Reference Manual > 19 Common SQL > 19.6 Working with date fields

NextPrevUpTopContentsIndex

19.6.1 Testing date values

Compare DATE values by formatting the date as a string in a date format that the database can parse. For example:

(sql:select * :from [Table] :where [= [Date] "25-Dec-2005"])

Note that it is not possible to lookup date values in the database using numeric values. This is because:

  1. Common SQL cannot know that the field will be a date field until the results are returned, and
  2. the database probably does not know about Common Lisp universal time.

LispWorks User Guide and Reference Manual - 22 Dec 2009

NextPrevUpTopContentsIndex