Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Year 2003 being formatted as 2,003.00 1

Status
Not open for further replies.

jfrost10

Programmer
Jun 3, 2001
2,004
CA
Hey gang,

A coworker is having some weirdness with a formula.

he's got a string thats being output like this:

Year({his field with teh year value})

But it comes out as 2,003.00 instead of 2003

Any thoughts?

D'Arcy
 
Hi
try this

CStr(CDate(1996, 11, 1), "yy MMM dd, dddd")

Returns "96 Nov 01, Monday".

hopr this helps

cheers

pgtek
 
or
Year({his field with the year value})"0000"

 
or
ToText (YEAR({your field}), "0000")
 
The basic problem stems from the fact that a year is just a number, like any other. The same thing would happen with month and day, fyi.
 
Alternatively, you don't need a Year() formula at all.

Place the date field wherever you need it, right click it and select format field->Date/Time->Customize->Date/Time set to Date->Select Date->and set month and day to none.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top