Look through the examples...you will understand my problem.
Sub testdate(t1 As Date)
Dim s As Integer
t1 = Format(t1, "mm/dd/yy")
Debug.Print t
s = DatePart("m", t1)
Debug.Print s
End Sub
Call testdate(06/19/2009)
is giving 12
Call testdate(#06/19/2009#)
is giving 06....(correct value)
In my code, I have to extract the month and year part from cs4
Function IsDupeslam(cs1 As String, cs2 As String, cs3 As String, cs4 as date)
Dim y As Integer
y = DatePart("m", cs4)
debug.print y
End Function
obiviously the above code gives wrong result....
The solution i think will be to put the leading and trailing # to the date field...
Function dater11(d1 As Date)
Dim m1 As Integer
Debug.Print d1
m1 = Month(" & # d1 # &")...this code is to be corrected....
Debug.Print m1
End Function
Please help