Compare date and Month

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tthai
    New Member
    • Sep 2006
    • 1

    #1

    Compare date and Month

    Can someone help please
    I have 2 fields, date fied and period field, what I try to do is to automatically populate the period no field when entering a date field.

    Example: 1/1 - 28/1 - Period 1
    29/1 - 25/2 Period 2
    26/2 - 25/3 Period 3 ect
    ......
    2/12 - 31/12 Period 13
    In MS Access when we enter the date, I would like to have a period date automatically populated.

    Any help will be much appreciated
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    Hi,

    Type this function

    Datepart("ww", [Your date])

    :)

    Comment

    • PEB
      Recognized Expert Top Contributor
      • Aug 2006
      • 1418

      #3
      If you want to determine the period you can use a function like Switch

      Switch ([Your date] Between #01/01/2006# AND #28/01/2006#,"Period1" ,[Your date] Between #29/01/2006# AND #28/02/2006#,"Period2" ........ and so on)

      Have a nice day!

      :)

      Comment

      Working...