Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INDEX ON DateTime Field?
Message
From
27/10/1998 11:07:06
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
27/10/1998 10:55:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00150884
Message ID:
00151012
Views:
30
>>>I am having trouble get the proper return results
>>>when using an index tag on a datetime field. Try
>>>this and you will see what I mean
>>>
>>>CREATE CURSOR c_tbl (dt_tm T)
>>>INSERT INTO c_tbl (dt_tm) VALUES ({10/27/1998 08:30:00 AM})
>>>INSERT INTO c_tbl (dt_tm) VALUES ({10/27/1998 08:31:00 AM})
>>>INDEX ON dt_tm TAG dt_tm
>>>SELECT * FROM c_tbl WHERE dt_tm = {10/27/1998 08:30:00 AM}
>>>
>>>?_TALLY && returns nothing
>>>
>>>SELECT c_tbl
>>>DELETE TAG dt_tm
>>>SELECT * FROM c_tbl WHERE dt_tm = {10/27/1998 08:30:00 AM}
>>>?_tally && returns 1
>>>
>>>Why am I getting inconsistent results?
>>Tom,
>>_tally is not a trustable system variable at all times. Explicitly check reccount() or alen().
>>Cetin
>
>Cetin, I would agree that _TALLY is not the best method. I was
>merely trying to convey the point that the results are not what
>I would expect. RECCOUNT() and a visual examination of the results
>show that _TALLY returned the correct results as presented above.

You mean _tally was true ? This routine returning correct record sets despite _tally returning 0 and 1 on my system. So I would suspect it's related with datetime settings in tools\options. I don't remember well but one of the settings in control panel (regional) + set sysformats on in tools\options\regional were showing interesting results with date and datetime operations.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform