- Richard Donagrandi
- PowerBuilder
- Monday, 15 July 2024 05:28 PM UTC
Not a question...
If you are converting from SQL Anywhere to SQL Server, be aware that Powerbuilder and SQL Server don't communicate dates well.
If you have a date parameter you are passing in SQL, embedded or in a datawindow/datastore like so:
CASE :adt_datetime is null THEN [this] ELSE [that] END
When you supply null, the statement works, but if you supply an actual date, the statement does not.
SQL Server is unable to read the parameter as a date -- or Powerbuilder isn't passing it as a date. -- Either way, change it to:
CASE CONVERT( datetime2, :adt_datetime) is null THEN [this] ELSE [that] END
This goes for dates, too, not just datetimes.
Thanks for coming to my TED talk...
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.