date type in ODBC

Hi,

I'm writing to an ODBC connection to a SQLserver database, and I seem to be sending the wrong data type to a date colum?

set tSC = ..Adapter.ExecuteUpdate(.intRows,sqlInsert,$ZDATETIME($NOW(),3,2), pRequest.ComposerName, [...])

I think  `$ZDATETIME($NOW(),3,2)` is ODBC datetime format: 

https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_fzdatetime#RCOS_fzdatetime_tformat

Do I have it wrong?

Stephen

Answers

$Now() gives you output in different format.
ODBC date format is 3. When dformat is 3 then ODBC date separator ( '-' ) is used. For all other date format space is used as a date separator.
Instead of $Now() you can use $H also.
Ex.
1. w $ZDT($H,3)
2019-02-02 10:25:58

  1. w $ZDT($Now(),3)
    2019-02-02 10:27:20