Hi All,
I posted the below in the Visual Basic forum and was advised to post it here as well. Hope you can help.
I am very new to VB.net and need a little help. I currently have a calculator to calculate the number of days between two days.
What i need now is something that will calculate working days between two dates (Mon-Fri being the workdays)
(See Below)
Thanks in advanceCode:Public Class GMPF_Calculator Dim d1 As Date Dim d2 As Date Dim days As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click '============Date fields Start============ d1 = TextBox1.Text d2 = TextBox2.Text If d1 > d2 Then MessageBox.Show("Start Date is greater than End Date", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning) Exit Sub End If days = DateDiff(DateInterval.Day, d1, d2) + 1 TextBox4.Text = days


Reply With Quote

