Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's to like about a datetime
Message
From
27/08/2018 17:06:41
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
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:
01661742
Views:
67
>And why would you use like with DateTime? Just for giggles? :-) Besides being invalid it'd also be much less efficient than using = given that like is a pattern matching operation.

I wouldn't, of course. But once upon a time, some 15+ years ago, I was working on an app compiling historical data gathered from spare resources, and there were many partial dates - for example, the year was known, and the day of the month, usually the day of the week (posters, bills, tickets), but the month itself was not. I solved that by keeping two shapes of the date - an exact date field for known dates, and the date matching pattern for partials.

Then it just occured to me that searching by two different partial dates may give an intersection, perhaps there was another source for the same event which had the month and day and day of the week but not the year which would refer to the same event and we could eventually have the date. So just thought a search like that may have pulled something useful. Of course, it's all just an idle thought experiment, I've lost contact with that customer years ago. But since the idea occurred to me while I was at the keyboard, cost nothing to try. Of course, even if it worked (and it would have, with conversion of the date into appropriate string format) it wouldn't lead to any results even back then, because we don't have date fields with partial values. Now comparing those partial dates, with a like operation which would allow for wildcards on both sides, that would have been something.

We have a proverb here, "an idle priest baptizes kids" (kids as goatlings, not children).

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