Thanks... I tried it but with $D+1 and $M... Because it is complaining abot month and days not in range... But some how the time diff is showing 0 even after i put different dates... I could see from the log the dates but for both the dates the retuen value is showing up the same??? Any thoughts....