I inherited a program, written in perl-script (.asp) that acts as a front-end to a MS Access database which stores our company statistics. The problem is that the original database's date fields are set as type "text" instead of type "date", so when a SQL query from the program calls items sorted by date, they are sorted alpha-numerically instead of chronologically. The dates are stored in the database as mm/dd/yyyy.
If I change the date fields in the database to type "date", the database queries correctly, but the front-end interface stops working! I am trying to avoid re-writing this thing, as it is rather large (although it would be considerably smaller if written correctly), so I would like advice on writing a sub function that would sort the returned record array by date (again, in the format of mm/dd/yyyy).
I do not know if there is a pre-existing function that will:
a) cast the record substring as a date, and
b) sort them by date
or if I need to write the algorithm from scratch. Any help would be much appreciated!
Thanks!
deletion mistake
no I can't recover that
you didn't save it
-Shrubble
If I change the date fields in the database to type "date", the database queries correctly, but the front-end interface stops working! I am trying to avoid re-writing this thing, as it is rather large (although it would be considerably smaller if written correctly), so I would like advice on writing a sub function that would sort the returned record array by date (again, in the format of mm/dd/yyyy).
I do not know if there is a pre-existing function that will:
a) cast the record substring as a date, and
b) sort them by date
or if I need to write the algorithm from scratch. Any help would be much appreciated!
Thanks!
deletion mistake
no I can't recover that
you didn't save it
-Shrubble