format date variable

L

Layi Mon

Hi there,

The system date format is "yyyy/mm/dd".
Assume that today is sept 15, 2003.
Please look at my the following procedure.

Sub lin ()
dim strLin as string
strLin = date
End sub

The strLin format will be "2003/09/15".
If I want to format strLin into "yy/mm/dd", what is the
syntax? But I don't want change the system date format.

Excel 97 allow the following syntax but 2002.
strLin = format (strLin, "yy/mm/dd")

Your help appreciated,
Lin
 
C

Cheryl Fischer

In Access, you can use the Format() function, as well:

strLin = Format(Date(),"yy/mm/dd")

hth,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top