Skip to main content
Inspiring
January 5, 2007
Question

Synatax Query - Less than or Equal to

  • January 5, 2007
  • 3 replies
  • 363 views
Running on Linux, Apache, MySQL, PHP

I have an issue with a date query - possibly created by the MySQL format YYYY-MM-DD

I want to create a recordset where activities are less than or equal to today's date.

I've managed most of it but the result seems only to show less than and not less than and equal to.

This is the part of the query that is in question:

CONTNOTES.ACTDATE<='coldatetil'

I have tried =< without success

Any ideas?
This topic has been closed for replies.

3 replies

Inspiring
January 8, 2007
Any Ideas?
Inspiring
January 5, 2007
That's pretty much what the core of mine is:

SELECT CONTNOTES.ACTDATE, CONTACTS.CONTACTID, CONTACTS.LOGO, CONTACTS.COMPANY, CONTACTS.FULLNAME, CONTNOTES.NOTEUSER, CONTNOTES.STAGE, CONTNOTES.TYPE, CONTNOTES.NOTE, CONTNOTES.VALUE, CONTNOTES.COMPLETED
FROM CONTACTS INNER JOIN CONTNOTES ON CONTACTS.CONTACTID = CONTNOTES.NOTESCONTACTID
WHERE CONTNOTES.NOTEUSER='coluser' AND (CONTNOTES.ACTDATE<='coldatetil' OR CONTNOTES.ACTDATE is null) AND CONTNOTES.TYPE <>'10 note' AND CONTNOTES.COMPLETED=False
ORDER BY CONTNOTES.ACTDATE DESC

And yet it still only seems to return the less than part of <=
Inspiring
January 5, 2007
RichardODreamweaver wrote:
> I want to create a recordset where activities are less than or equal to
> today's date.

SELECT * FROM myTable
WHERE theDate <= CURDATE()

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/