Link to home
Start Free TrialLog in
Avatar of vbnetcoder
vbnetcoder

asked on

VB.net date code

What does this code do?

dtEnd = DateSerial(Year(dtSomething) - 5, Month(dtSomething), Day(dtSomething))
Avatar of Andrew Crofts
Andrew Crofts
Flag of Ukraine image

it assigns to dt end a date that is five years prior to the date in dtsomething

It subtracts five from the year portion then reconstitutes the date from the new year value and the same day and month
Avatar of vbnetcoder
vbnetcoder

ASKER

so basicly it returns the date five years earlier?
ASKER CERTIFIED SOLUTION
Avatar of Andrew Crofts
Andrew Crofts
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ty