.dtq 文件查询 .dbf 的 SQL 语法
在 Microsoft Visual Studio 2008 Pro Edition 中使用最新的 Visual Fox Pro OLE DB 提供程序。我无法在 *.dtq 文件中使用 SQL 函数。我有超过 181 个 *.dtq 文件,我最终需要从 sqlscript 调用这些文件,但我的问题在于尝试解析 dbf 文件中的列时。我需要的列包含一个时间,即。 HH:MM:SS 我需要能够解析时间列以仅提取小时或分钟。分钟将以 15 分钟为间隔进行划分,因此,只要时间 > 15 分钟,我就可以拉动。大于 0 但 < 15 这样我就可以每隔 15 分钟提取一次数据。通常我会使用像parse或parsname或split或decim或decim这样的函数,或者说转到字符空间#然后是#字符空间。就像在 dos 中一样,我可以使用 %TIME:~3,2% 来提取包含我需要的时间信息的列的分钟部分所需的信息。请帮我。提前谢谢您。
Using the latest Visual Fox Pro OLE DB Provider inside Microsoft Visual Studio 2008 Pro Edition. I cannot use SQL functions inside my *.dtq files. I have over 181 *.dtq files that I ultimatley need to call from a sqlscript but my problem lies when attempting to parse a column in a dbf file. The column that I need contains a time ie. HH:MM:SS I need to be able to parse the time column to pull just the hour or minutes. The minutes will be sectioned in 15 minute intervalls so ie for 15 on the hour I can pull as long as time is > than 0 but < 15 so that I can pull data for 15 minute intervals. Usually I would use a function like parse or parsname or split or decimal or decim or something that says go to character space # and then # character spaces after that. Like in dos i can use %TIME:~3,2% to pull information I need for the minute section of the column that contains the time inforamtion that I need. Please help me. Thank you in advanced.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然我并不直接熟悉 .dtq 文件(除非它们只是重命名的 .dbf 文件),但 VFP 具有日期/时间函数来为您获取日期字段的不同组成部分。但是,仅“TIME”组件没有数据类型。它通常只是存储为字符串(字符)列。但是,如果列是日期/时间,您可以使用
但是,您的示例显示 HH:MM:SS,因此我将仅存储为字符串。所以我会通过...
稍微偏离你的>来得到它。 0且< 15 并不代表真正的 15 分钟,而是 14,
如果您想要基于 1-15 分钟、16-30、31-45、46-60 的季度,则更改为
int( 1+val (...) 作为 QtrMinute
Although I'm not directly familiar with .dtq files (unless they are just .dbf files renamed), VFP has date/time functions to get different components of a date field for you. However, there is no data type for just "TIME" component. Its typically just stored as a string (character) column. However, if the column IS of a date/time, you can use
However, your example shows HH:MM:SS, so I'm going with stored as just a character string. So I would get it by...
Slightly off of your > 0 and < 15 which doesn't represent a true 15 minutes, but 14,
If you want the quarters based on 1-15 minutes, 16-30, 31-45, 46-60, then change to
int( 1+val (...) as QtrMinute