Forum Discussion

SaviNewman1's avatar
SaviNewman1
Qrew Trainee
11 months ago

Multiple rule date formula.

Good afternoon, 

I currently have a formula date named "Sanitary Survey Due" based on a different field:

WeekdayAdd([Last Hazard Survey:], 1305)

I also need this formula to have it so the date that is displayed for Sanitary Survey Due be ONLY the year, and not a date, but I don't know how to do this. 



------------------------------
Newman, Savi
------------------------------

7 Replies

  • There is a year function in QB to accomplish just this.

    [Year Of Sanitary Survey Due] = Year([Sanitary Survey Due])

    I believe the formula will need to be formula numeric.



    ------------------------------
    Mike Tamoush
    ------------------------------
    • SaviNewman1's avatar
      SaviNewman1
      Qrew Trainee

      That didn't work.

      So they have a date function that returns the year.

      I just can't figure out how to incorporate it into my current date formula.

      Year (Date d)

      Description: Returns the year number of the Date d.

      Example: Year([Start Date]) returns the year of the date that appears in the Start Date field.

      Year(ToDate("Jan 10, 2000")) returns 2000

      Now adding that information with my current "WeekdayAdd([Last Hazard Survey:], 1305)"

      Is my problem. :(



      ------------------------------
      Newman, Savi
      ------------------------------
      • MikeTamoush's avatar
        MikeTamoush
        Qrew Commander

        Try:

        Year(WeekdayAdd([Last Hazard Survey:], 1305))

        Remember, your formula currently returns a date. So if you are only returning the year, your field needs to be a formula numeric, not a formula date.



        ------------------------------
        Mike Tamoush
        ------------------------------