Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
how can i determine the difference in months between two given dates (in LOAD script) where the first date would always be the 1st month and the second date always be the nth month after the first date. example:
date 1: 2012-03-15
date 2: 2013-01-04
diff: 10
many thanks for some help!
Load DIV(Date#(date2,'YYYY-M-D') - Date#(date1,'YYYY-M-D'),30)+1;
Load * Inline [
date1,date2
2012-03-15, 2012-04-04 ]
Load DIV(Date#(date2,'YYYY-M-D') - Date#(date1,'YYYY-M-D'),30)+1;
Load * Inline [
date1,date2
2012-03-15, 2012-04-04 ]
=Month(Date#('2013-01-04','YYYY-MM-DD')) + Year(Date#('2013-01-04','YYYY-MM-DD'))*12 - (Month(Date#('2012-03-15','YYYY-MM-DD')) + Year(Date#('2012-03-15','YYYY-MM-DD'))*12) as DateDifference
or
=Month(Date#(DATE2,'YYYY-MM-DD')) + Year(Date#(DATE1,'YYYY-MM-DD'))*12 - (Month(Date#(DATE2,'YYYY-MM-DD')) + Year(Date#(DATE1,'YYYY-MM-DD'))*12) as DateDifference