读书人

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

发布时间: 2012-03-14 12:01:13 作者: rapoo

关于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

读书人网 >asp.net

热点推荐