Converting date to text

H

Harleston poacher

I need to automatically generate invoice numbers using yymmxx where yy is
the year, mm is the month and xx is a two digit number. The problem I have
is that extracting from, say 7/9/04, gives me the result of 49xx and not
0409xx. Is there an Access equivalent of the Excel text(value) function
that will return the text equivalent of a number.
 
D

Douglas J. Steele

Use the Format function.

Format([MyDate], "yymm") should give you two digit representations.
 
M

Maury Markowitz

Harleston poacher said:
0409xx. Is there an Access equivalent of the Excel text(value) function
that will return the text equivalent of a number.

Yes, the Format command.

myString= Format(Date(), "yymm") Sets the DayAndDate field to "Tuesday, Dec
2 2003" if the current date is 12/02/2003.

There's a bunch of examples, just type in "format" in help in Access or VB.
 
Top