Loading current date into database field

Typical task pupulating database field with current date can be 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 currect date format form the regional settings screen we can see that the format is dd/mm/yyyy

Windows Vista Regional SettingsAnother way to determine date format of GetSystemVariable('SYSTEM_DATE') is to execute it against non date field

Mapping using MS SQL Server connection with no date format

GetSystemVariable-No-FormatData preview screen
GetSystemVariable-Data-Preview

Mapping using MS SQL Server connection with currect date format

GetSystemVariable-CurrectFormat

If we specify wrong date format I won’t be able to load the data
GetSystemVariable-WrongFormat

As you can see order date field is missing.
DataPreview-Null

Another way of getting data is by using GetSystemDate function

GetSystemDate(Format):String, Returns Current system date/time in format specified

Expression-Editor-GetSystemDate
And last way is to use database functions for example getdate() for sql server

GetDateNote:

It does not work for MS SQL Server Connections use ODBC connection instead.
You may get error message saying that field must have date format. Just assign any date format.

"DBSL software is important part of core business processes and has enabled us to scale up our capacity."

Tim Matter
CRM Team manager,

Our customers

BP

BBC

HSBC

Orange

CAT

SEPA
emc
NHS
Australian Rugby Union
xerox
Databases we work with