[best viewed in fixed-width font]
OK, I've been bapping my head against tihs one for a while -- I've
*done* time restrictions before, tho normally by weeks or days. In
this case, i want to restrict to records from the past six months.
What am I missing? If I take out the time restriction in the below
select statement, I get all the records I'm looking for plus the older
records, so the problem is in that part of the select statement. When
I add it in, nothing matches at all, although I do have records within
the six month time frame.
SELECT
Foster_Dogs.dog_name,
Foster_Dogs.dog_status,
Foster_Dogs.date_resolved,
Foster_Dogs.adopting_family,
Foster_Dogs.foster_paperwork,
Foster_Dogs.dog_id,
Adoption_Applications.firstname,
Adoption_Applications.lastname
FROM Foster_Dogs, Adoption_Applications
WHERE dog_status = "Adopted" AND adopting_family = app_id
AND (date_resolved > DATE_SUB(NOW(), INTERVAL 6 MONTH)) <<< bad line
ORDER BY dog_name
Erk? Thanks. Private email is fine, especially if it's
something dumb. I did check the syntax at
http://www.mysql.com/doc/D/a/Date_calculations.html
and it looks right to me.
date_resolved is of type DATE.
--Cindy
--
[EMAIL PROTECTED]
---------------------------------------------------------------------
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