64,637
社区成员
发帖
与我相关
我的任务
分享
CString str_time_hh,strSql;// 声明两个变量str_time_hh和strSql
strSql.Format( "select datepart(hh,getdate())");//构造一个要获取当前时间的小时位的语句存在strSql中
m_ado.ExecuteQueryValue(strSql,str_time_hh);//执行上面的语句,取得的时间用str_time_hh返回
AfxMessageBox(str_time_hh);//用对话框显示取出的时间