Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Goodafternoon,
I have a field 'printingdate' which gives the date of making an invoice. I want to make a variable / field that gives the year + weeknumber.
With CTRL + ALT + V I have defined: year([Print Date])&'_'&week([Print Date])
But if I sort descending. I get 2016_3 above 2016_25.
So I like to get every weeknumber with 2 digits --> 2016_3 should be 2016_03.
How do I get this right?
Num(Week([Print Date]),'00')
Num(Week([Print Date]),'00')
Hi
year([Print Date])&'_'&week([Print Date]) please make this as
year([Print Date])&'_'&num(week([Print Date]) ,'00')
But not sure of 'sorting oder'
If the problem still persists, i think you should go for DUAL function for the correct SORTING .
Hello Alluraiah Allu,
The answer of Antonio Mancini was first and ok.
But about the DUAL function: how would it look like if I use that one?
If I don't use the NUM function, the value 2016_3 is seen as text, i guess?
Jharke,
however You can Use WeekName() function
WeekName(Date) -> 2016/04
This is Dual Field (Text and Number)
So, no problem with sort.
Regards,
Antonio
Thanks, the result is the same indeed, and easier (only the '_' becomes a '/' )