This should help:
VB Code:
Option Explicit Private Sub Form_Load() Dim x As Integer Dim strdatetime As String strdatetime = "10-Dec-05 08:50:25.000" MsgBox (strdatetime) 'gives me 10-Dec-05 08:50:25.000 x = InStrRev(strdatetime, ".") - 1 If x > 0 Then strdatetime = Left(strdatetime, x) End If MsgBox Format(strdatetime, "dd-mmm-yy hh:mm:ss") End Sub




Reply With Quote