i have tis code in sql and it works but which function can i use in vba to archive the same result.
RIGHT('00' + MONTH(lt.LveFromDate),2) --2021-03 --2021-03 --YEAR(lt.LveFromDate)
i have tis code in sql and it works but which function can i use in vba to archive the same result.
RIGHT('00' + MONTH(lt.LveFromDate),2) --2021-03 --2021-03 --YEAR(lt.LveFromDate)
try,
Sub test()
Dim s As String
Dim myDate As Date
myDate = Date
s = Format(myDate, "yyyy-mm")
End Sub