Paradox Community

Items in pnews.paradox-programming

Subject:Re: DateTime Query - Solved
Date:Wed, 25 May 2022 15:04:09 -0800
From:Peter <peterspammenot@whiteknight.email>
Newsgroups:pnews.paradox-programming
Here is the problem:
dt = datetime("05:01:01 PM, 05/24/2022")
No way, no how, can the millisecs be specified
tcu.locate("ApptID",dt) ;//will fail if the value searched is not 0 
millisecs

In my previous experiments, tcu.locate() worked AFTER I manually edited 
the target field; as I wrote below, the reason is, because manually 
editing the field set millisecs to 0, thus the locate criteria of 
dt=datetime("05:01:01 PM, 05/24/2022") then matched the edited record.

Summary
You cannot search for a datetime value in a field using 
dateTime("00:00:00 AM/PM, mm/dd/yyyy") because millisecs cannot be 
specified.

Thank you all for your patience and responses.

Peter


On 05/25/2022 03:10 p.m., Peter wrote:
>> And now weirder yet - sorting is haywire
>> The tbl has composite key
>> "apptid" datetime
>> "aptday" date
>>
>> Normal sorting
>> datetiime     date
>> 10:01:21 AM, 05/09/2022
>> 10:01:21 AM, 05/10/2022
>> 10:01:21 AM, 05/11/2022
>> 10:01:21 AM, 05/12/2022
>>
>> I edited the last record (backspace over the "2" and add it back)
>> The table re-sorts, the record I edited is now at the top
>> 10:01:21 AM, 05/12/2022 ---huh?
>> 10:01:21 AM, 05/09/2022
>> 10:01:21 AM, 05/10/2022
>> 10:01:21 AM, 05/11/2022
>>
>> each record I edit goes to the top
>> wth? 
> 
> Solved the sorting weirdness
> When a datetime is edited or entered (typed or [spacebar]) 
> interactively, the milliseconds assigned is "0"
> So when I was editing the "apptid" field (datetime()) millisec portion 
> would become 0 and thus go to the top.
> 
> Another experiment (interactive mode)
> insert record, press [spacebar] to insert a datetime
> insert another record, press [spacebar] to insert a datetime but before 
> posting, change the seconds to equal the first record and try posting.
> You will get a key violation because both records have 0 millisecs.
> 
> 
> On 05/20/2022 09:18 p.m., Peter wrote:
>> And now weirder yet - sorting is haywire
>> The tbl has composite key
>> "apptid" datetime
>> "aptday" date
>>
>> Normal sorting
>> datetiime     date
>> 10:01:21 AM, 05/09/2022
>> 10:01:21 AM, 05/10/2022
>> 10:01:21 AM, 05/11/2022
>> 10:01:21 AM, 05/12/2022
>>
>> I edited the last record (backspace over the "2" and add it back)
>> The table re-sorts, the record I edited is now at the top
>> 10:01:21 AM, 05/12/2022 ---huh?
>> 10:01:21 AM, 05/09/2022
>> 10:01:21 AM, 05/10/2022
>> 10:01:21 AM, 05/11/2022
>>
>> each record I edit goes to the top
>> wth?


Copyright © 2004 thedbcommunity.com