0

I get a syntax error in PSQL Control Center on an Actian 13 database when using Date_Part and I'm out of ideas on how to proceed.

There are two fields in the table I am querying 'Date' and 'CreateDate'. I get the same error when I involve either field. I have tried both 'month' and 'year' and have confirmed the field in the database is a Date field.

I have tried the following with no luck.

select date_part('month',CreateDate) from gl_trx3 where CreateDate = '2021-10-13'

I am using this specific date for example because there are records with that date saved.

The error message I get is below.

[LNA][PSQL][SQL Engine]Error in expression: date_part('month',CreateDate)

Anyone know what I am missing?

  • With pervasive you can use the functions: MONTH, YEAR, DAY, etc, see: https://docs.actian.com/psql/psqlv11/wwhelp/wwhimpl/js/html/wwhelp.htm#href=sqlref/scalarfunc.05.4.html (or, when you need same info for other version, start here: https://docs.actian.com/psql/#page/Welcome/Welcome_to_Zen_2fPSQL_Documentation.htm , pick version, and search for `MONTH`) – Luuk Jul 06 '22 at 17:36

1 Answers1

0

In the list of Time and Date Functions for Pervasive SQL13 the function date_part does not exist.

Using MONTH(dateexp) returns the month as an integer in the range of 1 to 12.

Luuk
  • 12,245
  • 5
  • 22
  • 33