Support for SQL Server DateTime2

This release enhances support for SQL Server datetime2, ensuring consistent handling of high-precision datetime values (up to 7 fractional seconds) across DataWindow, runtime, and the debugger.

  • Support datetime2 data type when creating a SQL Server database table in the Database painter.

  • DataWindow Update with parameter binding on datetime columns now works correctly with SQL Server datetime2, avoiding mismatches that could previously cause update failures.

  • DataWindow datetime/time data type supports values up to 7 fractional seconds precision; and datetime columns can display and handle 7-digit fractional seconds.

  • The debugger shows values up to 7 fractional seconds precision.

  • The following functions support up to 7 fractional seconds precision:

    • DataWindow functions: GetItemDateTime, GetItemTime, GetDataValue

    • JsonParser functions: GetItemDateTime, GetItemTime

    • Graph functions: grAddData, grDeleteCategory, grFindCategory

    • EditMask functions: GetData

    • DatePicker functions: SetValue

    • DynamicDescriptionArea functions: GetDynamicDateTime

    • System functions: DateTime(), Time(), Hour(), IsTime()

Please notice the following when upgrading the application:

  • Time() syntax changes

    To align with the 7 fractional seconds precision, the syntax for Time() has changed from

    Time (int h, int m, int s, int u)

    To

    Time (int h, int m, int s, long u)

    And zeros ("0") will be added to the beginning of fractional seconds to reach 7 digits, for example,

    tt = time(10, 11, 12, 123456)
    //returns value: 10:11:12.0123456
    
    tt = time(10, 11, 12, 1)
    //returns value: 10:11:12.0000001
  • PSR file incompatibility issue

    After datetime values support 7-digit fractional seconds, the value of fractional seconds will change when using PSR files exported from previous PowerBuilder versions. For example, 003450 will become 000345.

    To avoid incompatibility issues, please use the PSR file generated by 2025 R2 (do not use PSR files generated by 2025 or earlier versions).