Hi David,
You may try to use the code below.
[VB.NET]
Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArgs) Handles Command1.Click
Dim ss As String
Dim MyDate As Date
MyDate = #11/16/2003#
ss = Format(DateTime.FromOADate(MyDate.ToOADate -
DateSerial(Year(MyDate) - 1, 12, 31).ToOADate), "000")
MsgBox(ss)
End Sub
[VB6]
Private Sub Command1_Click()
Dim MyDate As Date
MyDate = #11/16/2003#
ss = Format(MyDate - DateSerial(Year(MyDate) - 1, 12, 31), "000")
MsgBox ss
End Sub
FYI
All the two sample will return 320, NOT 321.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure!
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.