SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Dec 2000
    Location
    Norcross, GA
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    "SELECT *, DATE_FORMAT(logdate,'%c/%e/%y') as logdate FROM daily WHERE TO_DAYS(NOW()) - TO_DAYS(logdate) <= 7"
    Returns all records, regardless of date.

    Code:
    SELECT *, DATE_FORMAT(logdate,'%c/%e/%y') as logdate FROM daily HAVING TO_DAYS(NOW()) - TO_DAYS(logdate) <= 7
    Returns no records, even through there are several matching the query in the table (logdate is a DATETIME column).

    Any ideas?

  2. #2
    SitePoint Zealot
    Join Date
    Dec 2000
    Location
    Norcross, GA
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Scratch that -- the second example DOES work - there was another problem that I overlooked.


Bookmarks

Posting Permissions

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