|
Good day all.
I am trying to display a specific date value which depends on the current date.For example if the month is June, any day of june, the Report date should display the last day two months back,So the Report date for June would be April 30th. In Sql it is coded like so, :-
dateadd(mm, datediff(mm, 0, getdate()) -1 , -1).
I have tried coding in ASP, VBScript :-
<%Response.Write(DateAdd("m",-2,"D",1,(Date)))%> .
I have managed to get the month using :-
<%Response.Write(DateAdd("m",-2,(Date)))%>
but this takes the date back to two months to the day. How would I code it
so that it can display the last date of the month two months back ?
Any advice is greatly appreciated.
Thanks,
Mitch......
|