| | |
how to find that a date exists in between two dates ?
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2008
Posts: 34
Reputation:
Solved Threads: 0
Hi friends,
could anybody guide me , how to find that a date exists in between two dates ?
For example : 23/09/2008 -- 28/09/2008 - I'am on leave.
When a attendence is entered for the date 24/09/2008 , then i should get a msg saying, that the given date exists in the leave date.
In a leave table, i already store the above two dates and save. I will enter the attendence in the front end
could anybody guide me , how to find that a date exists in between two dates ?
For example : 23/09/2008 -- 28/09/2008 - I'am on leave.
When a attendence is entered for the date 24/09/2008 , then i should get a msg saying, that the given date exists in the leave date.
In a leave table, i already store the above two dates and save. I will enter the attendence in the front end
•
•
Join Date: Oct 2008
Posts: 32
Reputation:
Solved Threads: 4
hi,
fetch your leave start date and end date
startdate = stdt
enddate = nddt
if currentdate >= stdt AND currentdate <= nddt
{
msgbox (".....")
}
fetch your leave start date and end date
startdate = stdt
enddate = nddt
if currentdate >= stdt AND currentdate <= nddt
{
msgbox (".....")
}
•
•
Join Date: Dec 2008
Posts: 10
Reputation:
Solved Threads: 0
Put the date in a variable first and then compare them.
VB.NET Syntax (Toggle Plain Text)
Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles MyBase.Load Dim dateFrom As Date = New Date(2008, 12, 1) Dim dateTo As Date = New Date(2008, 12, 5) Dim dateAttend As Date = New Date(2008, 12, 3) If dateAttend > dateFrom And dateAttend < dateTo Then MessageBox.Show("You're are on holiday!") End If End Sub
![]() |
Similar Threads
- Device Problem (Windows 95 / 98 / Me)
- This ought to be simple - extra spaces (PHP)
- Page cannot be displayed (Web Browsers)
Other Threads in the VB.NET Forum
- Previous Thread: complete records between two dates
- Next Thread: Threads and shared data problem
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account arithmetic array basic bing browser button buttons center check code combobox component crystalreport cuesent data database datagrid datagridview date datetimepicker dissertation dissertations dissertationtopic dropdownlist excel fade file-dialog filter ftp generatetags google gridview hardcopy images input insert intel internet mobile monitor ms net networking objects output panel passingparameters pdf picturebox picturebox1 port position print printing problem problemwithinstallation project save searchbox searchvb.net select serial settings shutdown soap survey table tcp temperature text textbox timer timespan toolbox transparency trim update updown user vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf year





