如何在何处格式化日期?

问题描述 投票:0回答:1

我有这个脚本:

select * from OPDN A 
where A."DocDate" between '2020/01/01' and '2020/01/31'

如何在哪里实现这种格式?

select * from OPDN A 
where A."DocDate" between '01/01/2020' and '01/31/2020'
sql hana
1个回答
0
投票

在Oracle中,它可以做到

select * from OPDN A 
where to_date(A."DocDate", 'DD/MM/YYY') between to_date('01/01/2020','DD/MM/YYY') and to_date('01/31/2020', 'DD/MM/YYY');
© www.soinside.com 2019 - 2024. All rights reserved.