Skip to Content
avatar image
Former Member

Crystal Reports 13:create a formula that will idenitfy the date of the following friday

If {Test Completion ETA} is not null then calculate the date for the next Friday and insert it into {Prod Deployment ETA}.

Anyone have any ideas how I might be able to do this?

Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 21, 2016 at 11:54 PM

    Hi Scot,

    Try this:

    If {Test Completion ETA} <> Date (0, 0, 0) Then 
       {Test Completion ETA} + (6 - DayOfWeek ({Test Completion ETA})) 
    Else Date (0, 0, 0); 
    

    Date (0, 0, 0) is a NULL date.

    Crystal starts the week on Sunday so Friday is actually day 6. You can check this by using DayOfWeek and use a Friday date. So now we can take the {Test Completion ETA} and add the difference between 6 and the DayOfWeek to get the next Friday.

    Good luck,

    Brian

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 21, 2016 at 09:43 PM

    Hi Scot,

    Hit the F1 key in CR Designer and then search for "friday" you'll get a few listings and this one may help you:

    DateSerial (year, month, day)

    Don

    Add comment
    10|10000 characters needed characters exceeded