Typical task populating database field with a current date can be done in several ways
First of all, we can use GetSystemVariable calculation function:
GetSystemVariable(VariableName)
GetSystemVariable returns value of 'VARIABLENAME'.
Possible values for 'VARIABLENAME' are:
COMPUTERNAME
OSUSERNAME
DBUSERNAME
BLOCKNUMBER
LINENUMBER
RECORDNUMBER
SYSTEM_DATE
SOURCE_FILE_NAME
SOURCE_TABLE_NAME
GetSystemVariable('SYSTEM_DATE') function teturns date according to the regional settings of computer.
It very important to use current date format form the regional settings screen we can see that the format is dd/mm/yyyy Another way to determine the date format of GetSystemVariable('SYSTEM_DATE') is to execute it against the non-date field
Mapping using MS SQL Server connection with no date format
Data preview screen
Mapping using MS SQL Server connection with correct date format
If we specify wrong date format I won’t be able to load the data
As you can see order date field is missing.
Another way of getting data is by using GetSystemDate function
GetSystemDate(Format):String, Returns Current system date/time in format specified
And last way is to use database functions for example getdate() for SQL server
Note:
It does not work for MS SQL Server Connections use ODBC connection instead.
You may get an error message saying that the field must have date format. Just assign any date format.