converting timestamp to date in where clause
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


converting timestamp to date in where clause Expand / Collapse
Author
Message
Posted 7/27/2008 5:06:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/27/2008 4:59:18 AM
Posts: 9, Visits: 2
HI All,

I need to write a delete statement which should convert the timestamp column to date in the where clause like below.

Delete from table a where current_date = cast(a.date_timestamp as date)

where a.date_timestamp is a timestamp column in the table a

current_date is the date column when the job runs daily.

I tried to execte the above quer but it is showing an error like..invalid ansi date operation...

Please help me how can i do this...

Regards,
mora


hi all
Post #12259
Posted 7/28/2008 11:14:44 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: Yesterday @ 4:07:32 AM
Posts: 35, Visits: 290
Hi,
please paste your query to get correct reply. When i run the query, its working perfectly.

delete from abc.table1 a where current_date=cast(a.today_timestamp as date);
its deleting the required records.




Regards:
Monika
Post #12308
Posted 7/28/2008 11:27:28 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 11/23/2008 11:25:35 PM
Posts: 76, Visits: 148
hi,

how did you define 'date_timestamp' field in your table?



-SN

Post #12310
Posted 7/29/2008 4:59:03 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: Yesterday @ 4:07:32 AM
Posts: 35, Visits: 290
its timestamp(0);

Regards:
Monika
Post #12328
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 12:43am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 7 queries. Compression Disabled.