function questions

D

David

Hello All,

Does anyone know the function used to get the current year as a single
digit. i.e 2005=5 2006=6

Also I have a report that I want to add a function to it that shows the
current month being represented by a letter. Like January would be A
February would be B March would be C. Would I create a table with all
the months in one column and corresponding letters in another and have
like a lookup function or is there a different way?

Thank you,
David
 
A

Andi Mayer

Hello All,

Does anyone know the function used to get the current year as a single
digit. i.e 2005=5 2006=6

Also I have a report that I want to add a function to it that shows the
current month being represented by a letter. Like January would be A
February would be B March would be C. Would I create a table with all
the months in one column and corresponding letters in another and have
like a lookup function or is there a different way?

Thank you,
David

1. Right(year(MyField),1)

2: chr(month(MyField)+64)
 
D

David

Hi Andi,

Thanks for your reply. I got the first part working but I am not sure
what you mean by the second part.
 
A

Andi Mayer

Hi Andi,

Thanks for your reply. I got the first part working but I am not sure
what you mean by the second part.


Press F11 (you are now in VBA)
if you don't see the "immediate window" press ctrl-G

now write:
?month(date)
you get 2 , because we have February

?Chr(65)

this give you an "A", because the Ascii-code of A is 65

64 plus the month will give you what you want
 
Top