Year()..to give only the last two digits?

# Thread: Year()..to give only the last two digits?

1. Senior Member
Join Date
Dec 1969
Posts
473

## Year()..to give only the last two digits?

Is there a way to display the year as 02 using the year function like getting just the last two digits of the year 2002, 2003 03, 2004 04 and so on?<BR><BR>I&#039;m asking this because I&#039;d like to populate a select list with 01,02,03 etc.. based on the present year. How can this be done?<BR><BR>Cheers!<BR>Mazza.

2. Senior Member
Join Date
Dec 1969
Posts
11,334

## Right(year(), 2) <nm>

boo

3. Senior Member
Join Date
Dec 1969
Posts
473

## RE: Right(year(), 2) <nm>

Cheers Ghostie!<BR><BR>Whoooo.<BR><BR>:)

4. Senior Member
Join Date
Dec 1969
Posts
473

## How can I get the zeros to show as well?

It works great but how can I get the number to comeout like 01 02 03 instead of 1 2 3? Is there like a fixed digit command or something similar?<BR><BR>

5. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## Right("00" & year(), 2) <eop>

.

6. Senior Member
Join Date
Dec 1969
Posts
11,334

## Weird

I thought it would grab that... hmmm.<BR><BR>Try one of 2:<BR><BR>Right(CStr(year()), 2) &#039;probably will work<BR><BR>Eh, I don&#039;t feel like typing the other one out yet. If this doesn&#039;t work, let me know and I will...

7. Senior Member
Join Date
Dec 1969
Posts
11,334

## Huh?

So today would give him "002"? What if he&#039;s looking at 99 also? "0099"?<BR><BR>Sleepy today or something? You need to get to bed earlier instead of out partying like some sorta single guy :p

8. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## Getting too...no THREE old SC

should i say TRY IT<BR><BR><BR>well it is Friday....ill let it slide THIS time<BR>:)<BR><BR>

9. Senior Member
Join Date
Dec 1969
Posts
11,334

## Compilation error

Looks like we&#039;re both sleeping... forgot to put a date between the year function.<BR><BR>Yeah, yeah, it works, but so does "0" & year(now)<BR><BR>Why put 2 zeros if you don&#039;t need to? *** is up with that? Why not put 1000 zeros since you&#039;re doing the right,2 anyways?<BR><BR>You lose this one.

10. Senior Member
Join Date
Dec 1969
Posts
473

## RE: Weird

Sorry Ghost, but the CStr didn&#039;t work, could you show me the other way? pleaseee!<BR><BR>Thanks. ;)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•