Subject date data in SQL statement
From Pieter van Heerden <psvh@mweb.co.za>
Date Fri, 24 Apr 2015 10:05:40 -0400
Newsgroups dbase.getting-started

In teh follwing:

q.sql = "select * where rdate >= :startdat and rdate < :enddate"
q.params["startdate"] = form.startdate.value
q.params["enddate"] = form.enddate.value

the startdate and enddates seems to be ignored, e.g. extraction will take place to beyond enddate.  Form.startdate and form.enddate comes from entryfields on the form linked to date spinbox fields in the table that is formatted as DMY.

I have tried to recreate the SQL query in the SQL builder by inputting specific dates, but is then confronted with the problem  that date format seems to be wrong - error "Type mismatch in expression".  How does one enter date in the SQL builder, I have tried '...', {...}, ctod(), date(), {d '...'} but none works as defined in SQL manuals I have looked at and I could not find the correct format explained in the OLH system.  The date format in this case is assumed to be yyyy-mm-dd.

Where woiuld I find an example code in dBase help function that would show me what a date format in an SQL statement should look like?  The date() function under local SQL tells me about extract() but not about what the date should look like.