日期:2014-05-17  浏览次数:20926 次

如何草时间字段里面截取需要的内容。
比如我有一个时间字段rs( "time ")里面的格式是2007-5-22
现在我想只截取   月和日期显示不显示年份,可以用month(rs( "time "))& "- "&day(rs( "time "))

这样可以实现,但我想用一个函数就截取出来   因该怎么截取

------解决方案--------------------
Function GetMD(datDate)
if datDate= " " or isDate(datDate)=false then
GetMD = Month(Now) & "- " & Day(Now) '可以自己设置某个日期
Exit function
end if

GetMD = Month(datDate) & "- " & Day(datDate)
End function