Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I'm using the following query:
$sql = "SELECT regTime FROM customers WHERE 'regTime' BETWEEN '2016-04-14 00:00:00' AND '2016-04-16 23:59:59'";
and the result i get is empty array.
what can be the solution ? and why it's happening ? Thanks.
WHERE 'regTime'
If you have to quote column names, use backticks (`).... simple single quotes (') indicate a string literal.... so you're trying to check if the string 'regdate' is between dates, not the column value
'
Add a comment
SELECT [originalAlarmTime] FROM [dbo].[Alarms] WHERE originalAlarmTime BETWEEN '2015-07-01 20:18:58.000' AND '2015-07-01 20:20:47.000'
SELECT [originalAlarmTime] FROM [dbo].[Alarms] WHERE originalAlarmTime >= '2015-07-01 20:18:58.000' AND originalAlarmTime <= '2015-07-01 20:20:47.000'
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.