before this i’m using this function to from 6 month date to today date..
dFromYear := AddMonth(dFromDate, -5);
dToYear := EncodeDate(iYr, iMon, DaysInMonth(iYr, iMon));
but now i want to get date from january until today date…for example if today month is september 2010 so i want to get date from january2010 to september 2010..if today date is may2009 so i want to get from january2009 to may2009..i hope anyone can help me..thanks
I’m not quite sure what you mean, but if you want to calculate the number of months from January to now there’s a function in DateUtils called MonthsBetween that will do it for you.
Like so: