?
Solved

VB.net date code

Posted on 2013-06-28
5
Medium Priority
?
271 Views
Last Modified: 2013-06-28
What does this code do?

dtEnd = DateSerial(Year(dtSomething) - 5, Month(dtSomething), Day(dtSomething))
0
Comment
Question by:vbnetcoder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:Philip Pinnell
ID: 39284181
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
0
 

Author Comment

by:vbnetcoder
ID: 39284186
so basicly it returns the date five years earlier?
0
 
LVL 13

Accepted Solution

by:
Philip Pinnell earned 2000 total points
ID: 39284200
yes

so for dtSomething = today (28/06/2013)

dtEnd would be  28/06/2008
0
 

Author Closing Comment

by:vbnetcoder
ID: 39284227
ty
0
 
LVL 13

Expert Comment

by:Philip Pinnell
ID: 39284264
Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month9 days, 8 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question