Search This Blog

Monday, June 10, 2013

%DateIn and %Dateout Meta Variables

%Datein  resolves to to_date('2013-06-10','YYYY-MM-DD')              
%Dateout resolves to to_char(date,'YYYY-MM-DD')

Easy way to remember , when to use %Datein and %Dateout.
Lets consider a simple database table below. 


To retrieve data for a particular date , we use WHERE criteria to filter rows.
So in this case date coulmn is filtered as of particular Date.
Similary, only Date Value should be inserted into the column of Date data type.

In both the cases,  %Datein can be used, since it resolves into Date data type.

To format the date output, we use to_char(date,format). So in this case we use %Dateout

No comments: