Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

238
Views
postgresql syntax error using DAY as date

I can't identify the syntax mistake on this query, where´s the syntax mistake?

SELECT A.WPAN8, A.WPSRP1, A.WPBP01, A.WPSLSM, A.WP55QTA1, A.WPCENTYR, 
A.WPAAN01, A.WPAAN02, A.WPAAN03, A.WPAAN04, A.WPAAN05, A.WPAAN06, 
A.WPAAN07, A.WPAAN08, A.WPAAN09, A.WPAAN10, A.WPAAN11, A.WPAAN12, 
cast(((((((cast(cast(((WPUPMJ / 1000) + 1900) as decimal (4,0)) as 
char(4)) || '-01-01 ') || substring(cast(cast((WPUPMT + 1000000) as 
decimal (7,0)) as char(7)) from 2 for 2)) || ':') || 
substring(cast(cast((WPUPMT + 1000000) as decimal (7,0)) as char(7)) from 
4 for 2)) || ':') || substring(cast(cast((WPUPMT + 1000000) as decimal 
(7,0)) as char(7)) from 6 for 2)) as timestamp)+ 
ceiling(cast(substring(cast(cast(((WPUPMJ + 1900000) - 1) as decimal (7)) 
as character (7)) from 5 for 3) as decimal (3)))DAY as maxdate FROM 
CRPDTA.F5742001 A where cast(((((((cast(cast(((WPUPMJ / 1000) + 1900) as 
decimal (4,0)) as char(4)) || '-01-01 ') || substring(cast(cast((WPUPMT + 
1000000) as decimal (7,0)) as char(7)) from 2 for 2)) || ':') || 
substring(cast(cast((WPUPMT + 1000000) as decimal (7,0)) as char(7)) from 
4 for 2)) || ':') || substring(cast(cast((WPUPMT + 1000000) as decimal 
(7,0)) as char(7)) from 6 for 2)) as timestamp)+ 
ceiling(cast(substring(cast(cast(((WPUPMJ + 1900000) - 1) as decimal (7)) 
as character (7)) from 5 for 3) as decimal (3)))DAY > '2000-01-01 
00:00:00.000000';

It is saying ERROR: syntax error at or near "DAY"

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

postgresql uses a slightly different interval syntax to that.

I think you want * '1 day'::interval instead of DAY

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!