# Need zero before single digit week number - HOW?

This topic is 6552 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

Hello

I have a situation where there is a date scheme my predecessor used. For example

if it was the date of 12/9/2003 he had assigned a "DATE NUMBER " of 0347 meaning

the year is 03 and the week of that year is 47 . I can figure this out but there is a problem I am having ...

If the week is in the first part of the year ( the single digit weeks) how can I get the zero placed in a calculation? for example

the date is 1/4/2004

I would need the date to calculate to 0401 meaning the 1st week of 2004

I could use some help here

Thanks

Stan

##### Share on other sites

Hi Stan

You could check to see if the week number was less than 10, if it is add on the 0, just incorporate this into your exisiting calc:

Case(WeekofYear(date) < 10 ,0 & WeekofYear(date),WeekofYear(date))

HTH

Ed

##### Share on other sites

Many Thanks ED

It certainly did help me

Thanks for the timeliness

Stan

##### Share on other sites

You can also tweak the Case function to remove redundancy.

Case(WeekofYear(date) < 10 ,"0") & WeekofYear(date)

##### Share on other sites

This topic is 6552 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account