J
JRP
I am trying to convert the a date like 20050621 to a numeric format in the
same layout as shown. I made a new function in the data base to do this
converting (see below) but everytime I try an run it in the query I get the
Undefined Function ConvertDatetoNumeric in Expression. Can somebody tell me
what I am doing wrong or what I need to correct this problem. I am on Access
2000 and my operation system is 2000.
Thanks>
Function ConvertDateToNumeric(pDate As Date) As Long
Dim LYear As Integer
Dim LMth As Integer
Dim LDay As Integer
'Extract the year, month, and day values from the date parameter called
pDate
LYear = DatePart("yyyy", pDate)
LMth = DatePart("m", pDate)
LDay = DatePart("d", pDate)
'Format new number as a ddmmyyyy value
ConvertDateToNumeric = Right("00" & CStr(LDay), 2) & Right("00" &
CStr(LMth), 2) & CLng(CStr(LYear))
End Function
same layout as shown. I made a new function in the data base to do this
converting (see below) but everytime I try an run it in the query I get the
Undefined Function ConvertDatetoNumeric in Expression. Can somebody tell me
what I am doing wrong or what I need to correct this problem. I am on Access
2000 and my operation system is 2000.
Thanks>
Function ConvertDateToNumeric(pDate As Date) As Long
Dim LYear As Integer
Dim LMth As Integer
Dim LDay As Integer
'Extract the year, month, and day values from the date parameter called
pDate
LYear = DatePart("yyyy", pDate)
LMth = DatePart("m", pDate)
LDay = DatePart("d", pDate)
'Format new number as a ddmmyyyy value
ConvertDateToNumeric = Right("00" & CStr(LDay), 2) & Right("00" &
CStr(LMth), 2) & CLng(CStr(LYear))
End Function