简体   繁体   English

Delphi 7,Titan BTrieve组件

[英]Delphi 7, Titan BTrieve Components

I am using Delphi 7, and Titan BTrieve to open a Pervasive Table. 我正在使用Delphi 7和Titan BTrieve打开一个普及表。

It is a TtbTable component. 它是一个TtbTable组件。

I am trying to apply the filter on a TimeStamp field with my code as follows: 我正在尝试使用我的代码将过滤器应用于TimeStamp字段,如下所示:

    Date:=InputDate;
    DateString:=FormatDateTime('DD/MM/YYYY HH:NN:SS', InputDate);
    Table1.Filter:='UPDATEDON > '+chr(39)+DAteString+chr(39);
    Table1.Filtered:=True;

The problem is that the filter results are incorrect. 问题是筛选结果不正确。 It returns records that are before the do not match the filter criteria. 它返回与过滤条件不匹配之前的记录。

the Table1.Filter, filters the data in TDataSet not in btrieve/pervasive. 在Table1.Filter中,将过滤TDataSet中的数据,而不是btrieve / pervasive中的数据。

the problem is the date in string format... you must use the formar YYYY-MM-DD and not DD-MM-YYYY because the string compare. 问题是字符串格式的日期...您必须使用格式YYYY-MM-DD而不是DD-MM-YYYY,因为字符串比较。

in a string compare 17-06-2012 is grater than 16-07-2012, (17>16) 字符串比较17-06-2012比16-07-2012更好,(17> 16)

从外观上看,您正在比较字符串,而不是日期。

What version of PSQL are you using? 您正在使用哪个版本的PSQL? Is the UPDATEDON field defined as a Timestamp in the Btrieve database? 是否在Btrieve数据库中将UPDATEDON字段定义为时间戳? If it's a timestamp, values are stored in 8-byte unsigned values representing septaseconds (10^-7 second) since January 1, 0001 in a Gregorian calendar, Coordinated Universal Time (UTC). 如果是时间戳记,则将值存储在8字节的无符号值中,这些值表示自0001年1月1日以来的公历(协调世界时(UTC))中的间隔(10 ^ -7秒)。 It is not stored as a string. 它不存储为字符串。

Btrieve / PSQL stores dates in the 'YYYY-MM-DD' format. Btrieve / PSQL以“ YYYY-MM-DD”格式存储日期。

WHat does a value from the UPDATEDON field look like? UPDATEDON字段中的值看起来如何? To use it as a filter, you need to make sure the filter value looks the same. 要将其用作过滤器,需要确保过滤器值看起来相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM