> Is it possible for mySQL to recognize and compare dates written in this > format: MM/DD/YY?
=the short answer is yes and no: "yes" it can be done by combining various SQL/MySQL functions, but "no" there is no easy 'built-in' method. > I know standard date format for mySQL is YYY-MM-DD, but I need to be able to =typo: YYYY-MM-DD or CCYY-MM-DD > support this other format if possible. For example, I have a string of > "01/30/02" and I just need to compare it to another value already in the dB, > being held as a varchar with a value of "02/28/02". I need to compare these > to determine if one date preceeds the other. =this is a perennial question. Check the archives for ready-solutions. =Be aware of ignorance/arrogance. Some countries use a MM/DD/YY format, others DD/MM/YY. Because of this, it might be better to avoid both (what do you think I mean if I write 01/02/03?) =From a logical point of view, the month-day-year is irrational because there is no succession of size/metric. We (humans) are used to thinking/writing in a succession, hence 1,234 is understood to be one thousand, two hundreds, thirty (three tens), and four singles/units, in descending succession of size/ascending levels of accuracy/precision. Thus day-month-year (succession from smallest to largest) seems to have some 'method' to recommend it. =The ISO (international) standard is CCYY-MM-DD. One suspects many international standards are chosen simply because the method is NOT in use anywhere and thus does not favor one 'group' over another - but in reality requires everyone to change. However... =when it comes to dates, most systems regard them as a sub-class of string/characters (cf numbers). Thus this format is really neat (or as mathematicians say "elegant") because with no 'calculation' they will do exactly as you ask: 2002-11-31 < 2002-12-01 (qed - no functions to call, no code to write)! =Now 'all' you need to do is to decide how to convert your incoming user data from human-speak to ISO, and any output vice-versa... =Regards, =dn --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php