Using date functions
Correctly dealing with dates and time is critically important in data warehouses. In the end, you should understand that this is one of the most important attributes in a majority of fact tables in your DWH, which defines the "position" of your data records. Lots of reports are filtering data by date-time fields before performing data aggregation. This is probably why Data Services has a decent amount of date functions, allowing a variety of operations on date-time variables and table columns.
Data Services supports the following date data types: date
, datetime
, time
, and timestamp
. They define what part of time units are stored in the field:
date
: This stores the calendar datedatetime
: This stores the calendar date and the time of the daytime
: This stores only the time of the day without the calendar datetimestamp
: This stores the time of the day in subseconds
How to do it…
Generating current date and time
Here is a script that can be included in your current script...