Postgresql 9.1
我正在尝试使用查询来查找时间表系统的2个日期和2个时间之间的小数/小数小时差异.我正在使用查询来确保软件(不是我编写的)没有任何错误.以下是我正在使用的表中的字段:startdate是Date字段,starttime是Time字段,enddate是Date字段,endtime是Time字段.
示例数据:
我也试过这个sql语句.
SELECT employeetime.dcmasterid as empid,
nonchargeabletime.startdate as ncsdate,
nonchargeabletime.starttime as ncstime,
nonchargeabletime.enddate as ncedate,
nonchargeabletime.endtime as ncetime,
employeetime.dchours as normhrs,
(timestamp (startdate || ' ' || starttime) - timestamp (enddate || ' ' || endtime)) as diffhrs
FROM employeetime, nonchargeabletime
WHERE (nonchargeabletime.employeetime=employeetime.dcautoinc)
AND (nonchargeabletime.startdate >= '2016-04-24')
AND (nonchargeabletime.startdate <= '2016-04-30')
AND (employeetime.dcmasterid IN ('BLURG'))
AND (nonchargeabletime.nonchargeabletype=10)
ORDER BY employeetime.dcmasterid, nonchargeabletime.startdate, nonchargeabletime.starttime;
Run Code Online (Sandbox Code Playgroud)
但是我startdate说它的语法错误(timestamp …
系统:
情况:
util2.pl必须使用 Mail::Sender,因为我无法在我们的 Perl 中使用更新的电子邮件发送程序,即使在搜索页面等之后。所以现在,我们必须使用 Mail::Sender。util2.pl通过 包含在链中的每个程序中require /path/to/util2.pl。perl /path/to/program.pl bunch of arguments 2>/tmp/stderr.txt但我仍然收到一封来自 cron 的电子邮件,其中包含此错误消息。也就是说,我每周都会每 10 分钟收到一封包含此错误消息的电子邮件。我最终收到了数千封包含此消息的电子邮件。问题:
非常感谢,这让我很头疼。
这让我很难过.我从i-net Clear Reports中复制并粘贴了一条SQL语句,并将其粘贴到Windows编辑器中,该编辑器正在编辑Ubuntu .sql文件,该文件只是一个文本文件.我已经连接到另一个MS SQL 2005服务器,没有问题通过isql和Perl.所以我遇到了一个带有大约10个连接的大型SQL语句的问题,并将语句简化为以下多行:
SELECT PKG.SO_ID
FROM
PACKAGES AS PKG
WHERE
PKG.tracking_no = '640038823199'
;
Run Code Online (Sandbox Code Playgroud)
此文件由多行带有unix行结尾组成.我的isql命令是:cat test1.sql | isql dsnname 'domain\username' password -v -b.
我使用-b作为批处理模式,因为我通过文件向isql发送输入.错误在第一行立即开始,但我仔细检查了语法,对于SQL Server 2005,'AS'在'PACKAGES AS PKG'中是可选的.
[37000][unixODBC][FreeTDS][SQL Server]Statement(s) could not be prepared.
[37000][unixODBC][FreeTDS][SQL Server]The multi-part identifier "PKG.SO_ID" could not be bound.
[ISQL]ERROR: Could not SQLExecute
[37000][unixODBC][FreeTDS][SQL Server]Incorrect syntax near the keyword 'FROM'.
[37000][unixODBC][FreeTDS][SQL Server]Statement(s) could not be …Run Code Online (Sandbox Code Playgroud)