In vba,I am trying to convert datetime stamp(1899-12-30T00:00:00.000+0000) from oracle server into dd-mm-yyyy. I need to have a date format which can be recognised by excel and display it in a specific manner using cell formatting (like excel is parsing the date from sql server into dd-mm-yyyy type on its own using cell formatting but unable to recognise the oracle format for the same).
For j = 1 To colCount
mainWorkBook.Sheets("sheet1").Range(colToLetter(j) & 1).Value = node(0).ChildNodes(j - 1).tagName
Next j
For i = 0 To rowCount - 1
For j = 1 To colCount
If IsDate(node(i).ChildNodes(j - 1).Text) Then
mainWorkBook.Sheets("sheet1").Range(colToLetter(j) & i + 2).Value = CDate(node(i).ChildNodes(j - 1).Text)
Else
mainWorkBook.Sheets("sheet1").Range(colToLetter(j) & i + 2).Value = node(i).ChildNodes(j - 1).Text
End If
Next j
Next i
Like
Operator for a fixed pattern, e.g. in a negative form viaIf Not If Not TestItem Like "##-##-##T##:##:##.###+####" Then …
- c.f. Help at VBA Language Reference - Like Operator - @HemantKumar – T.M.