Hi Monks,
I running a query to a database and after getting all the results back I am left with a problem trying to sort trough the values for displaying the data, since it's stored in different fields in the data base.
After the query, month (Field Name for the Month in DB table) gets stored in $month.
day (Field Name for the Day in DB table) gets stored in $day.
year (Field Name for the Year in DB table) gets stored in $year.
Now my problem is that I am trying to sort these values and format the dates properly like 11/25/2004 at the end, any suggestions?
I need to format the data and display an option of displaying in numeric order like:
<loop will be here>{
print “$day/$month/$year<br>”;
}
Result prints:
8/8/2004
1/13/2002
1/12/2002
2/10/2002
11/1/2000
Thanks for the help!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.