Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a statement in my script which gives me projects within a specific time frame. Each month, we want those projects that start/end year to date. Here is the portion of the line:
([Project Finish Date] >= '11/01/2014' and [Project Finish Date] <= '5/31/2015')
*NOTE: Nov 1 is the start of our fiscal year.
So at the beginning of a new month, I have to manually change the Project Finish Date to the last day of the current month. Is there a way to have it calculate this without having to change the date each month?
Any help would be great!
Thanks!
look in help:
MonthEnd(date [, shift = 0])
Returns a display value showing the month (formatted according to the MonthNames script variable) and year with an underlying numeric value corresponding to a timestamp with the first millisecond of the first date of the month. Shift is an integer, where the value 0 indicates the month which contains date. Negative values in shift indicate preceding months and positive values indicate succeeding months.
Examples:
monthname ( '2001-10-19' ) returns 'Oct 2001' with an underlying numeric value corresponding to '2001-10-01 00:00:00.000'
monthname ( '2001-10-19', -1 ) returns 'Sep 2001' with an underlying numeric value corresponding to '2001-09-01 00:00:00.000'
Thanks! The MonthEnd worked and this is now my new statement.
([Project Finish Date] >= '11/01/2014' and [Project Finish Date] <= MonthEnd(today(0),0)))