Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a date field built with the expression: mid(date(maydate),4,7) , the result has a format mm/yyyy. When i want to sort this field in my straight table it didn't work.
Someone can help me please.
Best Rgds.
Hi Attalah Abdelhamid, use the following expression to sort your value
date#('01/' & yourDateField,'DDMMYYYY')
Let me signal you also this post to which I replied
Sorry, I made a little mistake; the expression is
date#('01/' & yourDateField,'DD/MM/YYYY')
thank you googel84 for your proposition, i tried your solution but it did not work
Please, provide me with more details, a qvw will be very helpful to understand your problem.
Bye
Try this...
Date(Date#(mid(date(maydate),4,7), 'M/YYYY'), 'MM/YYYY')
Regards
Hi, you can try dual() maybe
dual(mid(date(maydate),4,7) ,maydate)
so you can sort by numeric value, because your text is going to be in MM/YYYY format, but the internal value will be a full date
rgds
PS. by the way the same result that you want can be with date(maydate,'MM/YYYY')
Thank u very much mr Héctor,
I have change my initial formulas by Date(mydate,'MM/YYYY') instead of mid(date(mydate),4,7), and then i just made sort by numeric value and it worked.
Thank u Tout le monde:)
Nice.
Remember flag the topic with the selected solution, to mark it as "Solved"
Rgds
Just to be clearer, the expression I suggested you was intended to be used to sort your listbox values, so you should have used it selecting the Expression option on tab Sort of List Box Properties.
Probably I hadn't been that clear.