Retrieve Time Field Gets Error In SQL Server
- New
- How-to
-
Gordon Weil
- PowerBuilder
- Monday, 3 August 2026 09:38 PM UTC
We have been deploying our PB app with SQL Anywhere and want to change to Microsoft SQL Server. We have converted our database to SQL Server. There is a Time field in our database. When we use SQL Server Native Client driver for our ODBC DSN the time field does not give us problems. Since the Native Client is no longer supported I want to use the SQL Server driver for our ODBC DSN. When I do that the time field gives the "invalid character value for cast specification" error every time I try to retrieve the time column. How do I handle the time column if I want to use the SQL Server driver in ODBC? I can change the datawindow to type char(15) instead of type "time" and then the retrieve works but then I need to change my code because the data type in PB is no longer time and I have a bunch of calls to GetItemTime that all fail. Is there a way to get the SQL Server driver to handle the casting instead of the PB code?
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.