1. Richard Donagrandi
  2. PowerBuilder
  3. Monday, 15 July 2024 17: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...



There are no replies made for this question yet.
However, you are not allowed to reply to this question.