Error Using MONTH (DATE (field)) with DB2

0
 
 
In need SQL query returns the month of a date that is in a field of type date in my DB2 database
 
Example:
SELECT
MONTH(DATE(DBA.ESTOQUE_SINTETICO.DTMOVIMENTO)) AS MES
 
Exception:
Reason: DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610, SQLERRMC=null, DRIVER=3.69.66
 
Errors in Dataset and Query Dialog:
- missing EOF at ')'
- mismatched input '.' expecting ')'
- missing 'FROM' at 'DATE'
- no viable alternative at input 'MONTH'
- mismatched input '(' expecting ')'

 

atendimento_3's picture
Joined: Sep 22 2016 - 11:49am
Last seen: 3 years 10 months ago

0 Answers:

No answers yet
Feedback