Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I am using below code to get 2 digit for year :-
Right(year(date),2) as [year_],
I am not able to sort the year in sequences from hi to lo
Any work around ?
PAul
Paul
You can create a dual for this, and sort it numerically, like this.
Dual(Right(Year(date), 2), YearStart(date))
HTH
Jonathan
Simply because year is now traited as Text o String format. Format your year using Date() function to retain it as Year. See line of script below:
Date(date,'YY') as [year_]
It is very important to keep year in it's original format. Hope it helps.
Thanks,
Bill
Paul,
Also, to not change your original script, please see image below:
Hi Bill
Hi Sir
I use
Date(date,'YY') as [year_]
i get duplicated year. any work around ?
Hi Paul,
Instead of this script
Right(year(date),2) as [year_], -- Right() will give you the result in string
you use this
Date(date, 'YY') as [year_] this will give you the year in date (numeric)
Hope this helps you.
Regards,
Jagan.
Try:
=Num(Mod(Year(date),100),'00')
You can try it in he script as well.
PFA
hi paul may i know why you use like that
Hi Nir
I am lazy to write code for year field :-
=
IF(year='2014','14',
IF(year='2013','13',
IF(year= '1997' ,'97',
IF(year= '1998' ,'98',
IF(year= '1999' ,'99',
IF(year= '2000' ,'00',
IF(year= '2001' ,'01',
IF(year= '2002' ,'02',
IF(year= '2003' ,'03',
IF(year= '2004' ,'04',
IF(year= '2005' ,'05',
IF(year= '2006' ,'06',
IF(year= '2007' ,'07',
IF(year= '2008' ,'08',
IF(year= '2009' ,'09',
IF(year= '2011' ,'11',
IF(year= '2012' ,'12',
IF(year= '2010','10'))))))))))))))))))
Hi Jagan
if i use :-
Date(date, 'YY') as [year_] this will give you the year in date (numeric)
My year field unable to sort like below :-
98 99 10 11
Hi Tres
Notice that it not able to sort . i need it :-
96 99 00 11 12