首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

关于access中,日间函数的使用解决思路

2012-03-14 
关于access中,日间函数的使用我有三个字符串strYear2004 strMonth01 strDay01 现在我想把他专

关于access中,日间函数的使用
我有三个字符串
strYear   =   "2004 ";
strMonth   =   "01 ";
strDay   =   "01 ";

现在我想把他专换成这样的时间:
2007-1-18  

请问用什么函数和具体实现?

还有,2007-1-18   13:39:33   时间为这样的话,我如何取得2007-1-18呢?

[解决办法]
DateTime dt;
dt = Convert.ToDateTime( "2007-1-18 13:39:33 ");

dt.Date( "2007-1-18 13:39:33 ");/////问题1

Response.Write(dt.ToShortDateString());///问题2



[解决办法]
SELECT format(column, 'yyyy-mm-dd hh:m:ss ') FROM tabel
SELECT format(strYear+ "- "+strMonth+ "- "+strDay, 'yyyy-mm-dd hh:m:ss ') FROM tabel

热点排行