What is {ts '2013-04-02 00:00:00'}?

耗尽温柔 提交于 2020-01-01 04:12:30

问题


when i analyzing running T-SQL I found a query that have {ts '2013-04-02 00:00:00'} in where clause. i was so curious about this and tried to find the source. It was executed by a CrystalReport Report.

here is the query.

SELECT *
FROM    [Table] B
WHERE   CONVERT(VARCHAR, [AddedDateTime], 111) 
        BETWEEN CONVERT(VARCHAR, {ts '2013-03-31 00:00:00'}, 111)
        AND     CONVERT(VARCHAR, {ts '2013-04-02 00:00:00'}, 111)

Can anyone tel me what is it and where we can use it?


回答1:


It's an ODBC literal escape sequence

ODBC defines escape sequences for date, time, and timestamp literals. The syntax of these escape sequences is as follows:

{ts 'value'}

where we can use it?

Anywhere where a datetime value is expected. ("timestamp" is SQL Standard vernacular for what SQL Server calls datetime).



来源:https://stackoverflow.com/questions/15759458/what-is-ts-2013-04-02-000000

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!