请问各位,我把7-6-05这样的字符串,添加进数据库的时候,系统自动把这个字符串内容转换为时间格式2007-6-5,但是我想让它为2005-7-6,怎么解决?谢谢了

解决方案 »

  1.   

    最近菜鸟实在是多了:^_^
    Private Sub Command1_Click()
        Dim MyDate As Date
        Dim szOld As String
        Dim i As Integer
        szOld = "7-6-05"
        i = InStrRev(szOld, "-")
        MyDate = Format(Right(szOld, Len(szOld) - i) & "-" & Left(szOld, i - 1), "yyyy-mm-dd")
        MsgBox "转换后的日期为:" & MyDate
    End Sub