Ive been told that you can reformat the way your date is printed (as I have done below)
Code: Select all
DATE_FORMAT(dateoflastcontact, '%d/%m/%y')
AS dateoflastcontact, DATE_FORMAT(datecontactagain, '%d/%m/%y')
AS datecontactagainnow my problem is that when I have a search box which gives the user an option to searcha last contact date of an organisation - I cant search in the form of my my UK date setting as I have done above. The only way the search query works is if I enter the US format.
example last contact date is 28th of febuary 2005 - I must enter this in STANDARD MYSQL FORMAT which is 05-02-28 - due to my reformatting above I make this appear as 28-02-05 - which is fine..
BUT when I search for 28-02-05 I get no results and when I search for 05-02-28 I still dont get any results BUT when I search for 2005-02-28 then I GET!! my results.
Im thinking I should just set the date fields as integer and store the dates as month-year i.e Feb - 05 which will make the search much easier..
Any advice or tips would be much appreciated..