inside SQL? you can use DatePart to get the different part of the date, use DateDiff to get the difference between two dates

解决方案 »

  1.   

    datepart和datediff两个函数可以做到的,我在这里说还不如你去看SQL的联机帮助。
      

  2.   

    不好意思,再请问一下,怎样在aspx页面用c#取得象1997-7-4那样的时间?还可以加上时分秒吗?谢谢!
      

  3.   

    DateTime.Now.ToShortDateString();
    ...another...为什么不看帮助呢
      

  4.   

    (DateTime)datareader["OrderDate"]
    转换后进行处理。
      

  5.   

    looking The DateTime Function, U can find what u can do. 
    maybe u would write the function what u want to do.
      

  6.   

    DateTime ds=DateTime.Now;//当前时间
      

  7.   

    SQL
    year()+'-'+month()+'-'+day()
    C#
    DateTime.Now.Year+'-'+DateTime.Now.Month+'-'+DateTime.Now.Day