943,929 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 3166
  • VB.NET RSS
Dec 11th, 2008
0

how to find that a date exists in between two dates ?

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 2
Light Poster
manoj_582033 is offline Offline
39 posts
since Nov 2008
Dec 11th, 2008
0

Re: how to find that a date exists in between two dates ?

hi,

fetch your leave start date and end date
startdate = stdt
enddate = nddt

if currentdate >= stdt AND currentdate <= nddt
{
msgbox (".....")
}
Reputation Points: 12
Solved Threads: 4
Light Poster
reena12 is offline Offline
32 posts
since Oct 2008
Dec 11th, 2008
0

Re: how to find that a date exists in between two dates ?

I did this condition but itis not working.
is there any other way to solve it
Reputation Points: 10
Solved Threads: 2
Light Poster
manoj_582033 is offline Offline
39 posts
since Nov 2008
Dec 11th, 2008
1

Re: how to find that a date exists in between two dates ?

Put the date in a variable first and then compare them.
VB.NET Syntax (Toggle Plain Text)
  1. Private Sub Form1_Load(ByVal sender As System.Object, _
  2. ByVal e As System.EventArgs) _
  3. Handles MyBase.Load
  4. Dim dateFrom As Date = New Date(2008, 12, 1)
  5. Dim dateTo As Date = New Date(2008, 12, 5)
  6. Dim dateAttend As Date = New Date(2008, 12, 3)
  7.  
  8. If dateAttend > dateFrom And dateAttend < dateTo Then
  9. MessageBox.Show("You're are on holiday!")
  10. End If
  11. End Sub
Reputation Points: 27
Solved Threads: 0
Newbie Poster
NEo4 is offline Offline
10 posts
since Dec 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: complete records between two dates
Next Thread in VB.NET Forum Timeline: Threads and shared data problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC