Hello All,

here my situation:

- Delphi 7
- MS Access 2003  mdb
- One field is of type Date/Time  (actually I am interested only in date)

Writing to this field via the program is simple:
 
with ADOQuery2 do begin
        Open;
        insert;
        FieldByName('data').AsDateTime:=DP_data.time;      // this is a 
DateTimePicker
         Post;
        close;
end;

And finally I have my date like 02.03.2009 (dd.mm.yyyy) in the field. 
Database is happy ;-)

Now the big problem :

How to sort records based on the date ?

example:

    tData:= DBGrid2.DataSource.DataSet.fieldByName('data').AsDateTime;
    sData:= formatDateTime('dd/MM/yyyy',tData);

    with ADOQuery2 do begin
        if active then close;
        SQL.Clear;
        SQL.Add('SELECT * FROM tbl_log');
        SQL.Add('WHERE data = ' + sData);
        open;

this give no errors but returns no informations too !!!

After spending long time googling, please give me an advice !  thank you ,

Pietro



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/advanced_delphi/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/advanced_delphi/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:advanced_delphi-dig...@yahoogroups.com 
    mailto:advanced_delphi-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    advanced_delphi-unsubscr...@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to