Hi everyone,
I am in need of help converting a date (ex: 01/01/2009 = 200901) to a string format as YYYYMM. I need to do this in a query. I am not advanced enough to solve visual basic coding.
This code below was written by someone who is no longer with the company. Can someone help me write this in a query to convert a date format to a string format as listed below.
Query statement:
YYYYMM: getYYYYMM([date shut down])
Calling this function:
Function getYYYYMM(ByVal dt As Date) As Long
Dim nYear As Long
nYear = Year(dt)
Dim nMONTH As Long
nMONTH = Month(dt)
getYYYYMM = 100 * nYear + nMONTH
End Function