CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 21

Thread: Date Comparison

Threaded View

  1. #16
    Join Date
    May 2012
    Posts
    7

    Thumbs up Re: Date Comparison

    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
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured