Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've a number of dates that I want to look like
201509
201508
.
.
.
201008 etc
The date right now looks like e.g. 15/12/2015 (European format).
I would like it to look like above so I've gotten so far.
=right(purgechar(Calls.Date,'/'),6)
will give me 122015
now I want to get it to look like 201512
I could get both values but how do I reverse concatenate?
right(right(purgechar(Calls.Date,'/'),6) ,2) gives me 12
left(right(purgechar(Calls.Date,'/'),6) ,4) gives me 2015
but how do I reverse it so the 2015 comes out first and then the 12???
Thanks in advance.
Sample script:
Table:
LOAD DateField,
Date(Date#(DateField, 'DD/MM/YYYY'), 'YYYYMM') as NewDateField;
LOAD Date(Today() + RecNo()) as DateField
AutoGenerate 365;
Output:
Try this:
Date(Date#(DateField, 'DD/MM/YYYY'), 'YYYYMM') as DateField
try
Date(date#(yourdate,'DD/MM/YYYY'),'YYYYMM')
Sample script:
Table:
LOAD DateField,
Date(Date#(DateField, 'DD/MM/YYYY'), 'YYYYMM') as NewDateField;
LOAD Date(Today() + RecNo()) as DateField
AutoGenerate 365;
Output:
SET DateFormat='M/D/YYYY';
change to
SET DateFormat='YYYYMD';
or
=SubField(Date,'/',3)&''&SubField(Date,'/',2)&''&SubField(Date,'/',1)
Hi Try Like this:
SET DateFormat='M/D/YYYY';
Data:
LOAD *,Date(Date#(DATE_VALUE, 'DD/MM/YYYY'), 'YYYYMM')as DATE_VALUE_Target INLINE
[DATE_VALUE
25/12/2015
15/11/2015
5/10/2015
25/12/2014
15/11/2014
5/10/2014
]
Everyone .... I cant believe I asked that question. I do apologise.
I was on holidays for two weeks and overcomplicated something so simple.
It happens to all of us
But I am glad, all of us were able to quickly help you out.
Best,
Sunny
Hi, BobbyDave,
It is a learning dude.