Hi
New to Delphi & programming.
Using Delphi 7 / Access db(2003) / ADO query / Jet 4.0 conn.
sDateEdit1 & 2 are AlphaSkin versions of Delphi DateTimePicker input fields, on a User Query form.
Trying to return records for wedding_date date range between these two date edit boxes and have
fallen foul of the Access # # and YYYY-MM-DD format issues.
Have got (finally...) to the sql below, but don't know how to format the sDateEdit1 & 2 fields to accept a User's date in dd/mm/yyyy format - but pass to SQL as YYYY-MM-DD format.
ADOQuery3.Close;
ADOQuery3.SQL.Clear;
ADOQuery3.SQL.Add ('SELECT Name_first, Name_Last, Wedding_Date FROM Contacts WHERE Wedding_Date BETWEEN #'+DateEdit1.Text+'# AND #'+dateEdit2.Text+'# order by wedding_date, name_last, Name_first') ;
ADOQuery3.Parameters.Clear
;
ADOQuery3.Open;
dbgrid1.DataSource:=dataso
urce3;
If I manually type dates in as say, 2008-01-01 - 2008-06-01 it all seems to work. So hopefully, if one of you smart guys can advise how to make the DateTimePicker convert a date to that format, all should be well!
Thanks,
Den
Start Free Trial