Lets just say I have a table with people's name and their birthday (date and time). I want to be able to find people's birthday (date and time) for today using the following SQL for SQLite.
SELECT * FROM Btable WHERE Bday = date('yyyy-MM-dd')
However, it is always returning with nil dataset. Do I need to also include the time as well?
What is exactly wrong with my SQL statement? If so, what is the correct SQL statement for querying for todays date.
UPDATE:
Here is my actual SQL statement using BETWEEN logic:
SELECT *
FROM Alarms
WHERE ALARMSTATE IN (0,1,2)
AND ALARMPRIORITY IN (0,1,2,3,4)
AND ALARMGROUP IN (0,1,2,3,4,5,6,7)
AND ALARMTIME BETWEEN date(2012-08-02)
AND date(2012-08-3)
ORDER BY ALARMTIME DESC