Creating a table


Creating a table

Hi all,

PLZ look into this query

Create table ptemp.ateds as (

select a.ACCT_I,a.Open_D, a.Clse_D, year(a.clse_d) - year(a.open_d) as dte from pvdata.acct_base as a having a.open_d != null and year(a.Open_D) != 1111 and a.ACCT_I like '%SAV%' order by a.open_d desc) with data

The code works fine without The create table statement but as soon as i run it using the create table statement it shows an error saying something expected between '.' and year.

If i remove all the year statements then the code wirks fine.

Plz heklp me solve this

Senior Apprentice

Re: Creating a table

Hi Ashutosh,

this problem pops up all every few days/weeks, the last time was yesterday :-)

Replace YEAR(a.clse_d) with EXTRACT(YEAR FROM a.clse_d)