DatePart月问题 [英] DatePart month problem

查看:98
本文介绍了DatePart月问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用DatePart返回两个月的月份。我想看看01,02,03,...... 10,11,12这几个月。我怎样才能做到这一点?我确定它与我的日期字段的格式有关,但我无法找出它的自定义格式。


谢谢,

ang

解决方案

你不能使用DatePart,但你可以用格式(YourDate,mm)


格式(现在,mm)例如将返回01



我正在尝试使用DatePart返回两个月的月份。我想看看01,02,03,...... 10,11,12这几个月。我怎样才能做到这一点?我确定它与我的日期字段的格式有关,但我无法找出它的自定义格式。


谢谢,

ang



格式


(DatePart(" m",#1/6/2006#) ,00)==> 01

I am trying to use DatePart to return a two digit month. I would like to see 01, 02, 03, ...10, 11, 12 for the months. How can I do this? I''m sure it has something to do with the format of my date field, but I can''t figure out the custom format for it.

Thank you,
ang

解决方案

You can''t with DatePart, but you can with format(YourDate,"mm")

format(now,"mm") for instance will return 01


I am trying to use DatePart to return a two digit month. I would like to see 01, 02, 03, ...10, 11, 12 for the months. How can I do this? I''m sure it has something to do with the format of my date field, but I can''t figure out the custom format for it.

Thank you,
ang

Format


(DatePart("m", #1/6/2006#), "00") ==> 01


这篇关于DatePart月问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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