Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
hi guys,
Is there any posibility can we some the no. of month between from and to date.
After selecting from and to date no. of month should be calculated.
e.g
if i select from date - 01/01/2011 and to date-01/07/2013 (format of date is dd/mm/yyyy) in slider/calender.
so no. of is 31 month is the answer.
Is there any solution relate to that so please help me out to this resolve.
 koushik_btech20
		
			koushik_btech20
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Use these part as script....
AdhocDate:
LOAD * Inline [
FromDate,ToDate
01/04/2013,05/07/2013
10/06/2013,06/08/2013
01/01/2011,01/07/2013
];
Date:
Load
    Date(FromDate,'DD/MM/YYYY') as %FromDate,
    Date(ToDate,'DD/MM/YYYY') as %ToDate
Resident AdhocDate;
DROP Tables AdhocDate;
In UI part:
Take Two List box %FromDate and %ToDate
and use a expression in a text object which is...
='Difference : '&((year(%ToDate) * 12) + month(%ToDate) - (((year(%FromDate) * 12) + month(%FromDate))) + 1)
check these....
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		try this:
Ceil((Date1-Date2)/30)
 
					
				
		
Hi tres,
Its a dynamic date selection in slider/calender based on that the expression should sum the no. of month between from and to date.
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		so, store the two dates(from and to) in two variables and then use the functions as above. right?
Ceil((Variable1-Variable2)/30)
 koushik_btech20
		
			koushik_btech20
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Use these part as script....
AdhocDate:
LOAD * Inline [
FromDate,ToDate
01/04/2013,05/07/2013
10/06/2013,06/08/2013
01/01/2011,01/07/2013
];
Date:
Load
    Date(FromDate,'DD/MM/YYYY') as %FromDate,
    Date(ToDate,'DD/MM/YYYY') as %ToDate
Resident AdhocDate;
DROP Tables AdhocDate;
In UI part:
Take Two List box %FromDate and %ToDate
and use a expression in a text object which is...
='Difference : '&((year(%ToDate) * 12) + month(%ToDate) - (((year(%FromDate) * 12) + month(%FromDate))) + 1)
check these....
 
					
				
		
thanks it's work
 
					
				
		
 orital81
		
			orital81
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try This:
Num#(Year(Date1)&Month(Date1))-Num#(Year(Date2)&Month(Date2))
See attached example
