ms-access built in function Month(number)

前端 未结 1 977
粉色の甜心
粉色の甜心 2021-01-23 13:38

I Have been playing with variations of the Month... function in access query builder. I am having trouble building a date value from an expression. I am looking to create my o

相关标签:
1条回答
  • 2021-01-23 14:01

    DateSerial requires three integers, year, month, day:

     DateSerial(1992,5,2)
    
     02/05/1992 ''Euro locale
    

    Year(Date()) returns an integer, so you can substitute:

     DateSerial(Year(Date()),5,31)
    

    Interestingly, the zeroth day is the last day of the previous month:

     DateSerial(2012,12,0)=30/11/2012 
    

    -- http://office.microsoft.com/en-ie/access-help/HV080206953.aspx

    As an aside, do not forget that all dates are numbers.

    Month(5) will equal 1, but Month(41263)=12 !

    Also

    ?month(100)
     4 
    ?Year(100)
     1900 
    
    0 讨论(0)
提交回复
热议问题