Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
left('7/8/2015',Index('7/8/2015','/',-1)-1) this is my function that output is 7/8 .But my requirement is i want only 8.
how we can achive it?
Hi,
my aim is by using left and index function how to achive it? for example
left('7/8/2015',Index('7/8/2015','/',1)-1) for the the o/p is 7
now i want get output is 8 how?
Hi prabhas,
just a suggestion.
appreciate your aim.. but if there is easy function to get the result why do you stick on your aiming function?
As others rightly mentioned, you cannot achieve 8 from left function it seems. as after Index function calculation it becomes left('7/8/2015',3) so it gives first 3 char from left which is 7/8.
Text Between seems to be the perfect solution as it can give you whatever is available between separators '/', should make more business sense although not sure of your actual objective of using this script.
Thanks,
Digvijay
Hi
exactly i am getting output like 7/8..After index function how it becomes left('7/8/2015',3) explain briefly?
The second parameter Index('7/8/2015','/',2)-1) calculates to 4-1, where 4 is the index of 2nd occurrence of '/'.
=Mid('7/8/2015',Index('7/8/2015','/',1)+1,Index('7/8/2015','/',2)+1-Index('7/8/2015','/',2))
=Right(Left('7/8/2015', Index('7/8/2015','/',2)-1),Index('7/8/2015','/',1)-1)
=Num(Month(Date#('7/8/2015','D/M/YYYY')))