Hi All,
I have this statement that has worked well with ADS but failed in PG because PG has no month function:
SELECT Month(GLBook.DocDate) AS COL01, SUM(case when pc = 'D' then amount else 0 end) AS COL02, SUM(case when pc = 'C' then amount else 0 end) AS COL03, 0 AS COL04, 0 AS COL05, '' AS AcctPeriod, '' AS Site, '' AS Account FROM GLBook WHERE GLBook.DocDate >= ? AND GLBook.DocDate <= ? AND Account = ? AND Site = ? AND OrgCode = ? GROUP BY Month(GLBook.DocDate)
Your help will be highly appreciated
Thanks
Joe
SQL STATEMENT WORKS WITH ADS BUT NOT PG
Re: SQL STATEMENT WORKS WITH ADS BUT NOT PG
Hi, Joe.
Maybe you try the DATE_PART function: https://neon.tech/postgresql/postgresql ... -date_part
Maybe you try the DATE_PART function: https://neon.tech/postgresql/postgresql ... -date_part
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: SQL STATEMENT WORKS WITH ADS BUT NOT PG
Hi Tom
The link is not accessible
Thanks
Joe
The link is not accessible
Thanks
Joe
Re: SQL STATEMENT WORKS WITH ADS BUT NOT PG
Mmh. Maybe it works if you copy this into your browser address row: neon.tech/postgresql/postgresql-date-functions/postgresql-date_part
Or just search for "Date_Part" and "PostGreSQL".
Or just search for "Date_Part" and "PostGreSQL".
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: SQL STATEMENT WORKS WITH ADS BUT NOT PG
Hi Tom
Got it. Perfect !!!
Many thanks
Joe
Got it. Perfect !!!
Many thanks
Joe