Occasionally, it is necessary to display a date on a report that is based on another date. For example, you would like to generate a report that has reminder dates based on the start date of an event. Crystal Reports provides a simple formula for manipulating dates in this manner. The formula is:
DateAdd(DatePart, Interval, OriginalDate)
You will need to replace the bold values with the correct values.
DatePart: This determines which part of the date (or time) should be manipulated. There are six, case sensitive options
- n = minutes
- h = hours
- d = days
- y = year
- s = seconds
Interval: This is the amount being added. It can be positive or negative. For example DateAdd('d',2,'1/1/2014') will result in 1/3/2014. DateAdd('d',-2,'1/1/2014') will result in 12/30/2013.
Original Date: This is your original date or time value. You may type in a quoted value such as '1/1/2014' or '12:00 am' or you may use a value from a database field, parameter or formula such as {EV700_FUNC_MASTER.EV700_START_DATE_ISO}.
For help formatting date values, please see https://supportcenter.ungerboeck.com/entries/24865018-Formatting-Dates-in-Crystal-Reports-in-Formula-Fields
Comments
0 comments
Please sign in to leave a comment.