Search code examples
crystal-reports

Is there a function that returns a date depending on the month assigned in Crystal Reports?


Is there an existing function in Crystal Reports?

Something like function({myTable.myDateColumn, x) //Where x is the number of the month and the function will return a date

Not like Month({myTable.myDateColumn) = x //Which I believe will just return a number.

Reason being: I need to get that date and assign it to a variable.


Solution

  • You could try the DateAdd() function.

    //Add 2 months to the database value
    DateAdd("m", 2, {myTable.DateColumn})
    
    //Subtract 3 months from the database value
    DateAdd("m", -3, {myTable.DateColumn})