Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can any one gie the easy example for inyeartodate
what is 0 or -1 year how it works
I checked help files its bit confusing for me ?
Thanks in advance
inyeartodate ( '2006-01-25', '2006-02-01', 0 ) returns true
The base date is 2006-02-01. So the year-to-date period is 2006-01-01 to 2006-02-01. The date 2006-01-25 lies within that period so the inyeartodate function returns true
inyeartodate ( '2006-01-25', '2006-01-01', 0 ) returns false
The base date is 2006-01-01. So the year-to-date period is 2006-01-01 to 2006-01-01. The date 2006-01-25 lies outside that period so the inyeartodate function returns false.
0 and -1 are the numeric values of the boolean false and true values.
From the help file:
InYearToDate (date, basedate , shift [, first_month_of_year = 1])
returns true if date lies inside the part of year containing basedate up until and including the last millisecond of basedate. The year can be offset by shift. Shift is an integer, where the value 0 indicates the year which contains basedate. Negative values in shift indicate preceding years and positive values indicate succeeding years. If you want to work with (fiscal) years not starting in January, indicate a value between 2 and 12 in first_month_of_year.
Examples:
inyeartodate ( '2006-01-25', '2006-02-01', 0 ) returns true
inyeartodate ( '2006-01-25', '2006-01-01', 0 ) returns false
inyeartodate ( '2005-01-25', '2006-02-01', -1 ) returns true
Can you tell us which of the examples from the help you don't understand?
inyeartodate ( '2006-01-25', '2006-02-01', 0 ) returns true
inyeartodate ( '2006-01-25', '2006-01-01', 0 ) returns false
can u give explination on this
inyeartodate ( '2006-01-25', '2006-02-01', 0 ) returns true
The base date is 2006-02-01. So the year-to-date period is 2006-01-01 to 2006-02-01. The date 2006-01-25 lies within that period so the inyeartodate function returns true
inyeartodate ( '2006-01-25', '2006-01-01', 0 ) returns false
The base date is 2006-01-01. So the year-to-date period is 2006-01-01 to 2006-01-01. The date 2006-01-25 lies outside that period so the inyeartodate function returns false.