What is meant by Intervals in DateAdd(),DateDiff(),FormatDate()?

harish17

Active Member
Hi Everyone,
Can some one Please explain What is intervals in DateAdd(),DateDiff(),FormatDate()? Is there any Documentation with example's Please suggest me.

Thanks
 

Johnyhcao

New Member
Hi Harish, you can try to see the help document in BP, it enum the list of the interval for both DateAdd() and DateDiff(), the index is start wiht 0.

Interval DateAdd
0 Year
1 Week
2 (n/a)
3 (n/a)
4 Quarter Quarter
5 Month

For example, to add a number of months to a date use interval number 5. So to add 2 months to 26/5/1999, use DateAdd(5, 2, MakeDate(26,5,1999)). This would correctly return 26/7/1999.
 

VJR

Well-Known Member
Hi harish17,

- Open a Calc stage
- Click on the question mark sign on the top right hand corner of the window
- Type Datediff on the search box at the left hand side
- Double click Datediff when it comes up
- This will open up the details of the Datediff function along with the interval constants and also help on other Date functions.
 

Aliva

New Member
Hi,
Can someone help me in validating a date which should be greater than 7 days from today.
I have used the expression as : - DateDiff(8, Today(), [Item Data.Departure_Date])
But while evaluating the expression, it throws error as " DateDiff function requires 3 arguments of types: (number,datetime,datetime) "
 

johnsonrinkesh

New Member
Hi Aliva, we dont have any interval as 8.
Interval should be either 0 for years, 1 for week, 4 for quarter, 5 for month and 9 for days.
Change the dates to datetime and try the below:
DateDiff(9, FormatDateTime((Today(),"dd/MM/yy"), FormatDateTime(AddDays(Today,1),"dd/MM/yy")).
The above format will give you the difference in days. Hope this will help you.
 
Top