Date trouble

  • Thread starter Thread starter Derek Brown
  • Start date Start date
D

Derek Brown

Hi all

I'm trying to get into two text boxes called "Start" and "Finish"

Start = "01\01\" & DatePart("yy", Date)
Finish = Date
But I can only get
Start = "01\01\" & DatePart("yyyy", Date)
Finish = Date

It seems obvious by the help file that to show only the last two digits of
the year should be "yy" but I get an error when I run it. Why?
 
Use Format function instead of DatePart for this purpose:

Start = "01\01\" & Format(Date(), "yy")

or the Year function with the Format function:

Start = "01\01\" & Format(Year(Date()), "00")
 
Back
Top