Example: 99 is the value in the column, and I want to set it to 1999.
Thanks!
Is this a Date field or a Character field that contains text representing a
date or year? If the former you should know that Access always stores dates
exactly the same way. What you "see" is only a display format which by
default follows the date format set in your Windows Control Panel. Any
place where the date will be "seen" you can apply any other valid date
format.
If the field contains character data then I would need to know exactly how
the entries are formatted to be able to answer.
"Rick Brandt" <RBr...@Hunter.Com> wrote in message
news:a68cpv$cg78n$1...@ID-98015.news.dfncis.de...
Thanks,
Anthony
"Larry Linson" <larry....@ntpcug.org> wrote in message news:<OsWh8.7675$J3....@nwrddc01.gnilink.net>...
Here is a code that will only work correctly if the dates are between
1951 and 2050:
fFix(strAbbrev As Integer) as String Dim strCent As Integer If strAbbrev
> 50 Then strCent = 19 If strAbbrev <= 50 Then strCent = 20 fFix =
strCent & strAbbrev End Function
Good luck, Matt(+)
--
Posted via dBforums
http://dbforums.com
Function FourYearDate (pstrYear as String) as String
Dim intYear as Integer
If Len(pstrYear) > 0 and Len(pstrYear) < 3 Then
intYear = CInt(pstrYear)
If intYear > 30 Then
FourYearDate = Format(1900 + intYear, "YYYY")
Else
FourYearDate = Format(2000 + intYear, "YYYY")
End If
End If
End Function
You'll need to add your own error handling for the case where the string is
empty or too long, or for an error that CInt might throw if you passed in
"RB" instead of numeric characters.