由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - change year format in Access by SQL query (转载)
相关主题
error of sql query in MS Access database (转载)怎么变 2D的table为3D 的
问个SQL的问题再来一个SQL Server的面试题
oracle和XML求教sqlzoo euro 2012 第十三题 (转载)
[转载] question about SQL in Accessoracle pl sql recursive function
[转载] Can anyone interpret this simple SQL?How to query a tree
新手请教几个sqlzoo上的问题[转载] access问题请教
error run SQL query from pyodbc python 3.2.5 (转载)高手请进,问个SQL问题
请教一个SQL query该怎么写pls help me in this Sql query
相关话题的讨论汇总
话题: year话题: access话题: query话题: int话题: cast
进入Database版参与讨论
1 (共1页)
l******9
发帖数: 579
1
【 以下文字转载自 Quant 讨论区 】
发信人: light009 (light009), 信区: Quant
标 题: change year format in Access by SQL query
发信站: BBS 未名空间站 (Mon Oct 13 12:50:53 2014, 美东)
I am working on Access 2012 on win 7. In a table, I need to change a year
date format from '1-Jan-06' to 2006 and from '1-Jan-90' to 1990. I only need
year.
This is my query
SELECT *,
CASE
WHEN CAST(right(year_date,2) , INT) <= 12
THEN 2000 + CAST(right(year_date,2) , INT)
ELSE 1900 + CAST(right(year_date,2) , INT)
END
FROM my_table;
I got error:
syntax error (missing operator) in the query expression of 'CASE -- END'.
B*****g
发帖数: 34098
2
http://www.mitbbs.com/article/Programming/31374551_0.html

need

【在 l******9 的大作中提到】
: 【 以下文字转载自 Quant 讨论区 】
: 发信人: light009 (light009), 信区: Quant
: 标 题: change year format in Access by SQL query
: 发信站: BBS 未名空间站 (Mon Oct 13 12:50:53 2014, 美东)
: I am working on Access 2012 on win 7. In a table, I need to change a year
: date format from '1-Jan-06' to 2006 and from '1-Jan-90' to 1990. I only need
: year.
: This is my query
: SELECT *,
: CASE

1 (共1页)
进入Database版参与讨论
相关主题
pls help me in this Sql query[转载] Can anyone interpret this simple SQL?
请教一个ACCESS的土问题新手请教几个sqlzoo上的问题
ask for help with a simple query!!!error run SQL query from pyodbc python 3.2.5 (转载)
请教一个SQL Query请教一个SQL query该怎么写
error of sql query in MS Access database (转载)怎么变 2D的table为3D 的
问个SQL的问题再来一个SQL Server的面试题
oracle和XML求教sqlzoo euro 2012 第十三题 (转载)
[转载] question about SQL in Accessoracle pl sql recursive function
相关话题的讨论汇总
话题: year话题: access话题: query话题: int话题: cast