[MonetDB-users] Problem with YEAR, MONTH, DAY functions

Stefan Manegold Stefan.Manegold at cwi.nl
Thu Oct 20 08:21:27 CEST 2011


Hi,

YEAR is also a keyworkd in SQL.
To indicate that you want to use the function (identifier) YEAR, you need to
wrap it in double quotes, e.g.,

sql>select year( '2002-03-21');
syntax error, unexpected YEAR in: "select year"
sql>select "year"( '2002-03-21');
+-------------------+
| year_single_value |
+===================+
|              2002 |
+-------------------+
1 tuple (1.735ms)

Stefan

On Thu, Oct 20, 2011 at 01:52:25AM +0300, Roula Avg wrote:
> Hello,
> sorry to ask again but i have problem with YEAR, MONTH and DAY functions.
> According to the references YEAR for example can take as argument a date or
> a timestamp or a month_interval value. So if i run the query:
> sql> select year(current_timestamp); or sql> select year( '2002-03-21') it
> should return 2011 and 2002. Instead of this, i take: *syntax
> error,unexpected YEAR in: "select year". *What am i doing wrong?
> 
> Thank you very much in advance

> ------------------------------------------------------------------------------
> The demand for IT networking professionals continues to grow, and the
> demand for specialized networking skills is growing even more rapidly.
> Take a complimentary Learning at Ciosco Self-Assessment and learn 
> about Cisco certifications, training, and career opportunities. 
> http://p.sf.net/sfu/cisco-dev2dev

> _______________________________________________
> MonetDB-users mailing list
> MonetDB-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-users


-- 
| Stefan.Manegold @ CWI.nl | DB Architectures (INS1) |
| http://CWI.nl/~manegold/ | Science Park 123 (L321) |
| Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam  (NL) |




More information about the users-list mailing list