Author Topic: How to sort by date?  (Read 1837 times)

0 Members and 1 Guest are viewing this topic.

Brick_top

  • Guest
How to sort by date?
« on: November 16, 2015, 06:26:52 AM »
Hi there I have a lot of data in a program of mine but I'm having a hard time trying to sort this data by date.

Anyone has a function for it?

here is how an entry of my data is

Quote
("Inum 999" ("Joaquim Maria" "80" "Casado(a)" "Trabalhador" "" "Alandroal" "Alandroal" "José Francisco Saial" "Gertrudes Maria" "7,10,1978" "8,10,1978" "2 Esq" "" "1" "" "Comprada" "Sem Info" "Leandra Maria Pedreiro Gomes" "15,7,1975" "119" "Sepultura Comprada Por Leandra Maria Pedreiro Gomes" "Covais 9" "" "" "M"))

I need to sort a list of thousands of this by the date on the bold part.

I have tried with vl-sort but it is getting over my head

I will be posting what I have. thanks

David Bethel

  • Swamp Rat
  • Posts: 656
Re: How to sort by date?
« Reply #1 on: November 16, 2015, 07:02:24 AM »
Can you use this date format ?
Code: [Select]

(strcat YYYY "," MM "," DD)


"2015,01,26"


-David
R12 Dos - A2K

Brick_top

  • Guest
Re: How to sort by date?
« Reply #2 on: November 16, 2015, 08:55:07 AM »
do you mean that by using that format you could turn

this "2015,01,26" into this 20150126 and sort from that?

thanks.

David Bethel

  • Swamp Rat
  • Posts: 656
Re: How to sort by date?
« Reply #3 on: November 16, 2015, 09:09:27 AM »
That's 1 possibility.

I would think you could keep the commas if needed. 

You would need to include leading zeros for single digit months and days.
R12 Dos - A2K

Brick_top

  • Guest
Re: How to sort by date?
« Reply #4 on: November 16, 2015, 09:11:38 AM »
didn't think about this option...

I'm trying it right now.

thanks a lot!!


Brick_top

  • Guest
Re: How to sort by date?
« Reply #5 on: November 16, 2015, 09:42:52 AM »
finally I think it worked out correctly

thanks for your idea

David Bethel

  • Swamp Rat
  • Posts: 656
Re: How to sort by date?
« Reply #6 on: November 16, 2015, 10:18:47 AM »
You're welcome  -David
R12 Dos - A2K