I need a simple Visual Basic coding for developing a days between two dates calculator. I am new to visual basic and need further help.
The program should contain Two text boxes
text1.text for Initial Date
text2.text for End date
And the no. of days between these dates should be displayed in a label.
Please help me overcoming this problem by posting a suitable source code for this VB 6 project.
Any help would be highly appreciated.
Thanx in advance....
Tarpit Sahu
Thank You very muck for your
Thank You very muck for your kind help
Date Difference
Private Sub cmdCalculate_Click()
lblYears.Caption = ""
lblMonths.Caption = ""
lblDays.Caption = ""
lblQuarter.Caption = ""
lblCalenderWeeks.Caption = ""
lblWeeks.Caption = ""
lblHours.Caption = ""
lblMinutes.Caption = ""
lblSeconds.Caption = ""
lblYears.Caption = DateDiff("YYYY", dtpStartDate.Value, dtpEndDate.Value)
lblMonths.Caption = DateDiff("M", dtpStartDate.Value, dtpEndDate.Value)
lblDays.Caption = DateDiff("D", dtpStartDate.Value, dtpEndDate.Value)
lblQuarter.Caption = DateDiff("Q", dtpStartDate.Value, dtpEndDate.Value)
lblCalenderWeeks.Caption = DateDiff("WW", dtpStartDate.Value, dtpEndDate.Value)
lblWeeks.Caption = DateDiff("W", dtpStartDate.Value, dtpEndDate.Value)
lblHours.Caption = DateDiff("H", dtpStartDate.Value, dtpEndDate.Value)
lblMinutes.Caption = DateDiff("N", dtpStartDate.Value, dtpEndDate.Value)
lblSeconds.Caption = DateDiff("S", dtpStartDate.Value, dtpEndDate.Value)
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 Then
End
End If
End Sub
Private Sub Form_Load()
dtpStartDate.Value = Date
dtpEndDate.Value = Date
End Sub
Post new comment