Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Date Format

forums forums SQLyog Using SQLyog Date Format

  • This topic is empty.
Viewing 5 reply threads
  • Author
    Posts
    • #8117
      roy
      Member

      Hello,

      I am trying to use SQLyog with MySQL server. I have tried to use the following

      query:

      select * from leave2 where FrDate >= 09/01/2003

      This should return an empty dataset (there are no FrDate's after

      9/1/2003), but instead, it returns everything. How do I format the date in this

      query properly?

      Thanks,

      Roy

    • #14726
      Ritesh
      Member

      MySQL keeps data in YYYY-MM-DD format. Probably this query will help –

      select * from leave2 where FrDate >= '2003-01-09'

      HTH

    • #14727
      Shadow
      Member

      Dates must be given in year-month-day order (for example, '99-07-30') and not in month-day-year commonly used in English-speaking areas.

    • #14728
      ppetsinis
      Member

      Is there anyway to change the default date format (possibly in a .ini or .cfg file) from YYYY-MM-DD to another format ? (ie, mm/dd/yyyy or any user-defined format).

      The useage that I'm looking at is to import a CSV file into a table (using Load data infile …. command) where dates are stored in mm/dd/yyyy format and can change based on the source of the data. I can import the date fields into a char field and then convert it but would like to save the time to transform and copy contents into another table.

      Thanks

      Paul

    • #14729
      Ritesh
      Member

      Well, you can't.

      MySQL does not support different date-formats.

    • #14730
      Shadow
      Member

      MySql recognizes dates in various formats, if you are lucky enough, then will transform your data from mm/dd/yyyy format to its own, provided you don't feed date columns as varchar to MySql. It works for me via ADO…

Viewing 5 reply threads
  • You must be logged in to reply to this topic.