Access表格中有一个常规日期类型
比如2006.9.20 12:32:32
请问有没有函数直接可以得到这个字段的月,比如这个的9
谢谢

解决方案 »

  1.   

    Access有一个函数:Monthselect Month(your_date_time_field) from table_name
      

  2.   

    CString CAssistant::timeCString(COleDateTime a,bool isHaveHMS)
    {
    try
    {
    if(isHaveHMS == true) //是否带小时分秒
    {
    return a.Format(L"%Y-%m-%d %H:%M:%S");
    }
    else
    {
    return a.Format(L"%Y-%m-%d");
    }
    }
    catch(char *e)
    {
    return L"9999-9-9";
    }
      

  3.   

    }isHaveHMS 。。一看就是自己写的方法。。
    你这样lz是不会懂地
      

  4.   

    select Month(your_date_time_field) from table_name
    -----同意