Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    2,047
    Thanks
    120
    Thanked 78 Times in 78 Posts

    date to date join

    have two tables, in first dates as normal, like:

    01.01.2011
    06.01.2012
    etc

    in second all that matters is month and day, like

    Code:
    month        day
    1             1
    1             6
    need to join those on date, what do you suggest for joining, or for table 2 modification ?
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    29,435
    Thanks
    85
    Thanked 4,912 Times in 4,873 Posts
    Code:
    SELECT list, of, fields
    FROM table1, table2
    WHERE Month(table1.field) = Month(table2.field)
    AND Day(table1.field) = Day(table2.field)
    Be yourself. No one else is as qualified.

  • #3
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    2,047
    Thanks
    120
    Thanked 78 Times in 78 Posts
    hmm, yes, I just have bad filing having dates in joins.
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    29,435
    Thanks
    85
    Thanked 4,912 Times in 4,873 Posts
    I have never had problems joining on dates, so long as the fields involved really are DATETIME fields and not some other incorrect type of field.
    Be yourself. No one else is as qualified.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •