I am trying to get my start date set at the first day of the week and at 0 hours.
vb Code:
Select Case Now.DayOfWeek Case DayOfWeek.Sunday : dtStart = DateTime.Now.AddDays(-0) Case DayOfWeek.Monday : dtStart = DateTime.Now.AddDays(-1) Case DayOfWeek.Tuesday : dtStart = DateTime.Now.AddDays(-2) Case DayOfWeek.Wednesday : dtStart = DateTime.Now.AddDays(-3) Case DayOfWeek.Thursday : dtStart = DateTime.Now.AddDays(-4) Case DayOfWeek.Friday : dtStart = DateTime.Now.AddDays(-5) Case DayOfWeek.Saturday : dtStart = DateTime.Now.AddDays(-6) End Select
Right now it is setting the date minus 5 days and using the current time (8/12/2007 8:50:14 PM) because I am using DateTime.Now. How can I set it so that it will come up as 8/12/2007 12:00:00 AM
By the way I know there has to be a more elegent way to achieve what I am trying to accomplish but so far I have come up empty.




Reply With Quote