Kenny,
What are you attempting to do?
DateSerial is used to return a Date value in both VB6 & VB.NET, not the
internal representation of a date.
In both VB6 & VB.NET you would use DateSerial like this:
Dim d As Date
d = DateSerial(2003 , 12, 1)
Remember that in VB.NET that the internal representation of a date has
changed from the VB6 internal representation of a date. VB6 (COM) defined a
date based on a Double, VB.NET (.NET) defines it based on an Long (64 bit
integer).
Hence the need to call Date.ToOADate.
Dim d As Date
Dim f as Double
d = DateSerial(2003 , 12, 1)
f = d.ToOADate()
d = Date.FromOADate (f)
Hope this helps
Jay
"Kenny" <an*******@disc ussions.microso ft.com> wrote in message
news:04******** *************** *****@phx.gbl.. .
I am having issues with the "Date.ToOAD ate" method in
VB .NET. I understand that in VB6 the function DateSerial
gives an internal representation of the date.
When I use the DateSerial method in VB .Net, dragging the
mouse over to the statement, VB .NET reports the following
"Conversion from 'Date' to "Double' requires calling
the 'Date.ToOAdate' method.
When I tyoe this method in, the syntax checker undelines
the method and will not compile. The
method 'Date.FromOADat e' works.
Can someone please shed some light.