Skip to Content
0
Former Member
Dec 18, 2010 at 10:48 AM

Calculate no. of working days between two dates

31 Views

Hai,

I designed one form with two date fields.

I want to calculate the no. of days between these two.

while getting the date from EditText box it returns as string.So, it returns Error as "Conversion from string "20101202" to type 'Date' is not valid." in case I choose date 02/12/2010

My Code is as follows:

Dim date1, date2t As Date

otext = oForm.Items.Item("date1text").Specific

date1 = CDate(otext .value)

Thanks in Advance.