Rub*_*ist 6 sql postgresql date-comparison
假设我将这种格式存储在我的postgre数据库表中.现在我必须将这个日期与其中一个texbox值包含不同格式的日期进行比较.
Database Date Format :: YYYY-MM-DD For example :: 2010-11-26
Text-Field Date Format :: Day, Month Date, Year :: Fri, Nov 26, 10
Run Code Online (Sandbox Code Playgroud)
现在我试图比较这个值但没有Plz建议的回应.
Select * from table_name where user_id=('11')
and to_char(effective_date, $$$$$$$$)=trim('Fri, Nov 26, 10');
Run Code Online (Sandbox Code Playgroud)
现在Plz建议我应该用哪种格式代替$$$$$$$$ ???
谢谢 !!!
Fra*_*ens 14
SELECT
*
FROM
table_name
WHERE
user_id=('11')
AND
to_char(effective_date, 'Dy, Mon DD, YY') = trim('Fri, Nov 26, 10');
Run Code Online (Sandbox Code Playgroud)
这应该这样做: to_char(effective_date, 'Dy, Mon DD, YY')
顺便说一句:这些都记录在手册中:http: //www.postgresql.org/docs/current/static/functions-formatting.html
| 归档时间: |
|
| 查看次数: |
56472 次 |
| 最近记录: |