Regarding date format

Database
Enthusiast

Regarding date format

Hi all,

I created a table 

create table financial.test

 (empid integer not null, 

 ename char(30), 

hiredate DATE FORMAT 'ddmmyyyy' )

primary index (empid);

and inserted data into it and the data is as fallows

empid ename hiredate

1 101 abc 01-01-2000

2 109 f 11-04-2013

3 108 e 12-04-2013

4 107 d 13-04-2013

5 106 c 14-04-2013

6 105 f 15-04-2013

7 104 e 16-04-2013

8 103 d 17-04-2013

9 102 c 18-04-2013

10 101 b 19-04-2013

but when i am firing the below query its showing zero records

sel empid,ename, cast (hiredate as date format 'yyyymmdd')

 from financial.test 

 where hiredate >=current_date -7 ;

can any one help this the data should come after 12th hired employees..


Tags (2)
1 REPLY
Teradata Employee

Re: Regarding date format

Dear, your hiredate is of year 2013 and current_date would definitely be of year 2014.