使用datepart如何在msaccess中获取日期的月份和年份 [英] using datepart how to get month and year of the date in msaccess

查看:462
本文介绍了使用datepart如何在msaccess中获取日期的月份和年份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数据库设计如下;

holidayDate



holidayDate在数据库中如下;

2/21 / 2013

2/25/2013

2/27/2013



存储在数据库中的dateformat是月份,日期和年份格式。





使用日期部分查询如何获取ms访问日期的月份和年份。 />


来自2013年2月21日,使用日期部分获取月份和年份,需要输出如下;



月份

2 2013



我该怎么办。



请帮帮我。



问候,

Narasiman P.

解决方案

< blockquote>查看这些链接..



http ://www.techonthenet.com/access/functions/date/datepart.php [ ^ ]







http://office.microsoft.com/en-in/access-help/datepart-function -HA001228812.aspx [ ^ ]


嗨试试这个,





string a = holidayDate.ToString(MM yyyy);





问候,

Prakash.T

Database design as follows;
holidayDate

holidayDate in database as follows;
2/21/2013
2/25/2013
2/27/2013

dateformat stored in the database is month,date and year format.


using date part query how to get month and year of the date in ms access.

fro the 2/21/2013 date,get the month and year using date part, output required as follows;

month year
2 2013

how can i do.

Please help me.

Regards,
Narasiman P.

解决方案

Check these links..

http://www.techonthenet.com/access/functions/date/datepart.php[^]

and

http://office.microsoft.com/en-in/access-help/datepart-function-HA001228812.aspx[^]


hi try this,


string a = holidayDate.ToString("MM yyyy");


regards,
Prakash.T


这篇关于使用datepart如何在msaccess中获取日期的月份和年份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆