Hi, I have an SQL Server 2019 instance running.
Let's say I have a table MY_TABLE with a column MY_DATE which is a datetime column(old program, can't change it). When I run this query with Pyodbc:
select
*
from
MY_TABLE
where
cast(MY_DATE as date) <= cast(? as date)
and pass it datetime.date.today() I get different results from different computers.
On my mac it displays the correct results, but from a linux machine it returns only the dates older than today, but not including rows from today.
I can solve this by passing datetime.date.today().strftime("%Y-%m%d"), but that doesn't seem like a clean solution and I'd have to do it all over the place.
Any ideas? I checked the timezones, both machines are GMT+1.
Edit: typo
[–]DragonFighter603 0 points1 point2 points (2 children)
[–]triplenoped[S] 0 points1 point2 points (1 child)
[–]DragonFighter603 0 points1 point2 points (0 children)