with adodataset do begin
  commandtext := 'select cast(date as smalldatetime) from table';
  open;
end
/*以上结果会在dbgrid中显示出来*/问题:当 date = '1999-09-09 00:00:00' 时dbgrid中只显示 '1999-09-09'但是在sql-server却可以显示为'1999-09-09 00:00:00' 。我要求dbgrid达到后一种结果,,怎么做??

解决方案 »

  1.   

    设置adodataset 的那个列的显示格式
      

  2.   

    dbgird中列的displayFormat属性
    yyyy-mm-dd hh:mm:ss
      

  3.   

    dbgird  ---> displayFormat属性
    yyyy-mm-dd hh:mm:ss
      

  4.   

    找不到 dbgrid---->displayformat 属性的。
    要用代码来实现吗?
      

  5.   

    没有发现displayformat 属性。。并且不是固定列要指定属性的,,是任意几列。。