.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Week Day Number
I am trying to load date data where my field 'createdate' will display "Year/Wk" (Example: April 15, 2014 would display '2014/16", the year and the week number).
In my script I have:
Date(WeekStart([createdate]), 'YYYY/WW') as [Yr/Week Opened]
However the date is displaying as "2014/00" on all records. How do I get the week number to display?
Thanks.
Jeff
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The format codes 'WW' is for weekday (so 00 since you are calling for weekstart)
- "WW" will return the number with two digits (e.g. 02 for Wednesday).
Use
year([createdate]) & '/' & week([createdate]) as [Yr/Week Opened]


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The format codes 'WW' is for weekday (so 00 since you are calling for weekstart)
- "WW" will return the number with two digits (e.g. 02 for Wednesday).
Use
year([createdate]) & '/' & week([createdate]) as [Yr/Week Opened]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you have to write two script and concat them try like
= Year(today())&'/'& Week(Today())

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For this script
Date(WeekStart([createdate]), 'YYYY/WW') as [Yr/Week Opened]
here 'YYYY/WW' is not working because it is a date format but you use 'WW' as week so for your script try like
Year( [createdate], 'YYYY') &' / '& Week ([createdate]) as [Yr/Week Opened]
or
Year( [createdate] ) &' / '& Week ([createdate]) as [Yr/Week Opened]
.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks swuehl.
Is ther any way to force the week number to display two digits? Like 01, 02, 03....?
It helps with the sort otherwise I get 1, 10, 11...2, 21, 22, 23...3, 31...etc.
Thanks.
Jeff


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use the num() function to format with two digits
num(week(Datefield),'00')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For week no with '00' use it like
Year( [createdate] ) &' / '& Num( Week ([createdate]) ,'00') as [Yr/Week Opened]
