Hello,
I need to get today's date (-365) in a shortdate type string, so that I can delete records older that a year (or so) from a DB.
I tried
Dim myyear As String = CStr(Today.Month) + "/" + CStr(Today.Day) + "/" + CStr(Today.Year - 1)
Dim targetdate As Date = CDate(myyear).ToShortDateString()
But it seems costly, is there any other built function to do this?
Thanks
I need to get today's date (-365) in a shortdate type string, so that I can delete records older that a year (or so) from a DB.
I tried
Dim myyear As String = CStr(Today.Month) + "/" + CStr(Today.Day) + "/" + CStr(Today.Year - 1)
Dim targetdate As Date = CDate(myyear).ToShortDateString()
But it seems costly, is there any other built function to do this?
Thanks
Last edited: