Keroleen Posted November 7, 2003 Posted November 7, 2003 Hi: Im wondering if anyone here knows how to calculate dates? For example, if a user using a datetimepicker, chooses a I have an ending date and staring date of a week. A user uses a datetimepicker to pick a date (they may pick any date). I want the application to be able to calculate which week the user has picked (that procedure is fine), and for that week the first day of the week and the last date. I believe in VBA its something like Dim dateTemp as Date Do Until DatePart ("w", dateTemp) = vbSaturday dateTemp = dateTemp - 1 In vb.net you cannot mix integer with dates to calculate. How to do this? Quote
Administrators PlausiblyDamp Posted November 7, 2003 Administrators Posted November 7, 2003 Dim dateTemp As Date Do Until dateTemp.DayOfWeek = DayOfWeek.Saturday dateTemp = dateTemp.Subtract(New TimeSpan(1, 0, 0, 0)) Loop Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.