- Olan Knight
- PowerBuilder
- Tuesday, 4 January 2022 04:04 PM UTC
PB2019R3, build 2703
Windows 10, 64 bit platform
PostgreSQL database connected with ODBC
I have a stand-alone datawindow which is a report. The full SQL is attached.
Here's a snippet of the problem lines in the SQL:
select
case
when to_number(to_char(:thru_bill_date,'MM')) - pd_ctr.pd_back <= 0 then
to_number(to_char(:thru_bill_date,'YYYY')) - 1
else to_number(to_char(:thru_bill_date,'YYYY'))
end ||'-'||
case
1) When I replace the parameter ":thru_bill_date" with TO_DATE ('11/05/2021,'MM/DD/YYYY') in an Oracle or a PG database, then it works.
However, I need the parameter as that value changes each month.
2) When I run this SQL with these lines in an Oracle database, it works.
When I run this SQL with these lines in a PG database, I get this:
3) When I replace the parameter ":thru_bill_date" with "TO_DATE (:thru_bill_date, 'MM/DD/YYYY')" in an Oracle database, I get this error:
When I replace the parameter ":thru_bill_date" with "TO_DATE (:thru_bill_date, 'MM/DD/YYYY')" in a PG database, I get this error:
4) When I replace the parameter ":thru_bill_date" with "TRUNC ( :thru_bill_date )" in an Oracle database, it works.
When I replace the parameter ":thru_bill_date" with "TRUNC ( :thru_bill_date )" in a PG database, I get this error:
Any ideas on how to get this to work? Or perhaps a work-around?
Thank You,
Olan
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.