Since I have moved to API 2.0, I have been using DateTime rather than Date for my database calls. All fields in my INSERT have been arriving OK, except DateTime. There is no error message returned, just a NULL value where the DateTime should go in the database. I’m not sure if this affects other databases, but I am writing to CubeSQL at the moment. It is something like this:
[code]Var tempDate As DateTime = DateTime.Now
Var tempSQLPreparedStatementMBS As SQLPreparedStatementMBS
Var db As SQLDatabaseMBS 'assume it connects OK
Var SQLCommand As String = “INSERT INTO Employees (Name, Created) VALUES (:Name, :Created)”
tempSQLPreparedStatementMBS = db.Prepare(tempSQL)
tempSQLPreparedStatementMBS.BindType(“Name”, SQLPreparedStatementMBS.kTypeString)
tempSQLPreparedStatementMBS.BindType(“Created”, SQLPreparedStatementMBS.kTypeDateTime)
tempSQLPreparedStatementMBS.Bind(“Name”,“Joe Bloggs”)
tempSQLPreparedStatementMBS.Bind(“Created”, tempDate)
tempSQLPreparedStatementMBS.ExecuteSQLMT
db.CommitTransaction[/code]
If I use tempDate.SQLDateTime and kTypeString, the Created field inserts the DateTime OK.
Is SQLPreparedStatementMBS.kTypeDateTime supposed to be able to take the new DateTime format?