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

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2008
Posts: 34
Reputation: manoj_582033 is an unknown quantity at this point 
Solved Threads: 0
manoj_582033 manoj_582033 is offline Offline
Light Poster

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

 
0
  #1
Dec 11th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 32
Reputation: reena12 is an unknown quantity at this point 
Solved Threads: 4
reena12 reena12 is offline Offline
Light Poster

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

 
0
  #2
Dec 11th, 2008
hi,

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

if currentdate >= stdt AND currentdate <= nddt
{
msgbox (".....")
}
Reena Mehta

Remember to click on Mark as answer on the post that helped

http://www.indianic.com
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 34
Reputation: manoj_582033 is an unknown quantity at this point 
Solved Threads: 0
manoj_582033 manoj_582033 is offline Offline
Light Poster

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

 
0
  #3
Dec 11th, 2008
I did this condition but itis not working.
is there any other way to solve it
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 10
Reputation: NEo4 is an unknown quantity at this point 
Solved Threads: 0
NEo4 NEo4 is offline Offline
Newbie Poster

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

 
1
  #4
Dec 11th, 2008
Put the date in a variable first and then compare them.
  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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC