ConvertToVTSDate

(ODBC Manager Library)
Description:Provides a format conversion of a date value from that used by the indicated database to the format used by VTScada.
Returns:The date value, converted to the standard VTScada format
Usage: Script only.
Related to:AddConnection | BuildDelete | BuildInsert | BuildSelect | BuildUpdate | ConvertToDbDate | ConvertToDbTime | ConvertToDbTimeStamp | ConvertToVTSTime | ConvertToVTSTimeStamp | CopyRecords | DBDropList | DBGridList | ErrMessage | ExecuteQuery | ExecuteQueryCachedFlushCache | FormatBatchQuery | GetConnList | ResultFormat | StatsWin | TableSynch | Transaction | TransactionCached
Format: \ODBCManager.ConvertToVTSDate(dbType,  ValueIn)
Parameters: 
dbType
Required numeric value, indicating the type of this DB connection.
DBTypeMeaning
0MS SQL
1MS Access
2Oracle
3MySQL
4SyBase
ValueIn
Required. Date value as used by the indicated database.
Comments:This module is a member of the ODBCManager Library, and must therefore be prefaced by \ODBCManager, as shown in "Format" above.

Example:

[
  VTDate;
  RightNow;
]
Init[
  RightNow = "2022-09-27"; If 1 Main;
  [
    VTDate = \ODBCManager.ConvertToVTSDate(3, RightNow);
  ]
]

In this example, VTDate is set to 19262.