Format Ledger Date text field yyyymm

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using Access 2002 and 2003.

I have a ledger date field that is text, ex: 200606 = YearMo

I'm trying to just get the month to display (for 200603 = Mar)

I'm a little new at this, so I've tried:

Month: Format(right([ledger date],2),"mmm")
oddly 200601 will return Dec and everything else returns Jan

Can someone help me figure out what I'm missing?
 
You would use the Format(...,"mmm") with date fields. Right([ledger date],2)
returns a string value of "06". Access is kind enough to convert this to a
date for you. That date is 6 which is actually #1/5/1900#.

You should not leave conversions to chance. Try
MonthName(Val(right([ledger date],2)))
Or
Format(DateSerial(2000,Val(right([ledger date],2)),1),"mmm")
 
Back
Top