Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's to like about a datetime
Message
From
24/08/2018 06:59:53
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
23/08/2018 19:17:28
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:
01661727
Views:
54
>Dragan, I think you'll find this is a date convert to human readable string issue, depending on SQL Server defaults.
>
>No doubt you also considered a parameterized query that avoids string cast and gets cached for efficiency:
>
>
ltStart={^2015-01-01}
>ltend=dtot({^2016-01-01})-1
>
>select * from mytable where mydate between ?ltStart and ?ltEnd
That's what I routinely do... just had this weird idea that, since there are no date literals in TSQL - it uses strings for that - then it may treat a date as a string at least while parsing. And as Cetin pointed out, it actually does, it's just that the default format isn't american standard.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform