Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's to like about a datetime
Message
From
06/09/2018 18:56:27
 
 
To
06/09/2018 18:28:00
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
MS SQL Server
Miscellaneous
Thread ID:
01661714
Message ID:
01661865
Views:
57
Likes (1)
>
Select myDate
>from DateTester
>where myDate like '2018-01%'
>order by myDate;
>
>You'll also get zero records from this, unless you've changed SQL Server's implicit cast. Try LIKE 'Jan % 2018%'

No, it works for me in MSSQL 2017 using the like '2018-01%'. Gets the records that are for January.

>I've never had issues with BETWEEN using datetimes and paremeterized queries. FWIW. If ticks ever did become an issue, I'd follow your mechanism re date, incrementing the upper boundary and using < if necessary.

Well, Cetin is correct when the datatypes are not Date and are some kind of Datetime instead. I wouldn't risk it.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform