query1.SQL.Add('select * from orders where ship_date=' + FormatDateTime('yyyy-mm-dd',tempdate) +''''); 
query1.Open;

解决方案 »

  1.   

    to windindance(风之舞) :
    上面的格式我看得不清晰,另外,若client端传的是string型,怎么办?
      

  2.   

    Project vDClient.exe
    raised exception class EOleException with message
    'Unexpected end of command.
     Token
     Line Number:1'.Process stoped.
      

  3.   

    query1.SQL.Add('select * from orders where ship_date=' + tempdate +''''); 
      

  4.   

    to windindance:query1.SQL.Add('select * from orders where ship_date=' + FormatDateTime('yyyy-mm-dd',tempdate) +''''); 
    query1.Open;After compiled ,it displaies error info:'Type dismatch in expression.'
      

  5.   

    this is the date format error.change 'yyyy-mm-dd' to you database system date format.
      

  6.   

    我所使用的数据库是ORACLE,应该任何写?