Hey guys,
I thought getting yesterday's date was now() - 1 but visual studio is giving me error saying '-' is not the right operator. I think now() - 1 was used in VB6. whats the correct way of obtaining yesterday date?
Hey guys,
I thought getting yesterday's date was now() - 1 but visual studio is giving me error saying '-' is not the right operator. I think now() - 1 was used in VB6. whats the correct way of obtaining yesterday date?
Jump to PostDim Yesterday As Date = DateAndTime.DateAdd(DateInterval.Day, -1, DateAndTime.Now)
Dim Yesterday As Date = DateAndTime.DateAdd(DateInterval.Day, -1, DateAndTime.Now)
thanks but is there a shorter way of coding? shorter is easier to remember..
Remember dateadd and you'll be able to look it up (VS help or google) when you forget it.
got it... i also found the shorter easier way.
Today().AddDays([I]number_of_days(+/-)[/I])
thanks for the help guys
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.
You're trying to visit a URL that doesn't currently exist on the web. Most likely, a member posted a link a long time ago to a web page that has since been removed. It's also possible that there was a typo when posting the URL. We redirect you to this notice instead of stripping out the link to preserve the integrity of the post.