question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BETWEEN does not work

See original GitHub issue

I cannot affect the schema as this is a read only database. We have unix timestamps that I’d like to perform a where between query on. I get valid results from mysql itself but through this I get absolutely nothing not even an error.

Would any be willing to attempt a select {something} from {somewhere} where timestamp between {some lower value} and {some upper limit}; ? I believe it is failing in this package. Stamps are INT.

ie

SELECT * FROM actions WHERE stamp BETWEEN '1000000000' AND '1567630955' ORDER BY stamp DESC LIMIT 100;

Thank you for your attention.

version 5.7 server with package 2.17.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
dougwilsoncommented, Sep 5, 2019

It’s no problem. I wish I knew what was wrong to just have solution for you 😦

0reactions
etisdewcommented, Sep 5, 2019

Going to request a migrational field with proper date format and see if I can work with that. The size of the query without a range is simply too large to handle sort and filter client side.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Datetime BETWEEN statement not working in SQL Server
I set miliseconds to 998 because SQL Server was pulling in 2013-10-19 00:00:00:0000 in the query. SQL DATETIME fields have milliseconds. So I ......
Read more >
between two values not working in SQL Query - CodeProject
Try this. SQL. select * from tab1 where startsal between 1 and 89 and Endsal between 2010 and 8800.
Read more >
SQL WHERE BETWEEN | NOT BETWEEN - Dofactory
WHERE BETWEEN returns values within a given range. BETWEEN is a shorthand for >= AND <=. BETWEEN is inclusive, i.e. begin and end...
Read more >
SQL Between, MySQL Between Dates, Not Between
The SQL NOT BETWEEN operator is used for getting the values as part of result set which is outside of the range specified...
Read more >
BETWEEN (Transact-SQL) - SQL Server - Microsoft Learn
NOT BETWEEN returns TRUE if the value of test_expression is less than the value of begin_expression or greater than the value of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found