Jump to content

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

Recommended Posts

Posted

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

but instead I get 041

I could use some help here

Thanks

Stan

Posted

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

Posted

You can also tweak the Case function to remove redundancy.

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.