Question : I am trying to do a datestring that will go back a month.

I am trying to automate a program that will do a date string that will go back a month.  So I will run this lets say on November 1 2009, and I want the datestring to be 10/31/2009.  

Answer : I am trying to do a datestring that will go back a month.

if You want last date of previous month you can use following

Dim DateStr As String = Now.Date.AddDays(-Now.Date.Day).ToString("MM-dd-yyyy")

and if u want to go back by one month then

Dim DateStr As String = Now.Date.AddMonths(-1).ToString("MM-dd-yyyy")
Random Solutions  
 
programming4us programming4us