• Date function

    Author
    Topic
    #471009

    Using Access 2000

    A table has a Date field called CurDate, set to the default date of new record entered.

    On a form, I would like shown:
    If CurDate is between January 1 and June 30 of a given year, I would like that year shown…otherwise that year + 1.

    In other words…
    If the date of the new record is between January 1 and June 30 of 2010, the year 2010 would show on the form.
    If the date of the new record is between July 1 and December 31 of 2010, the year 2011 would show on the form.

    Thanks.

    Tom

    Viewing 0 reply threads
    Author
    Replies
    • #1239121

      Tom,

      you want a simple function along the lines of

      if curdate =>cdate(“01/07/” & year(curdate)) then

      [indent]Return year(curdate)+1[/indent]

      else

      [indent]return year(curdate)[/indent]

      end if

      I am sure you can tidy this up and get the syntax right! Could even be done with an IIF().

      Hope this helps,

      Jules

    Viewing 0 reply threads
    Reply To: Date function

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: