Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

elo =) I have a table with a TIM

Status
Not open for further replies.

Gandi

Programmer
Nov 12, 2002
3
DK
elo =)

I have a table with a TIMESTAMP in it, where i like a PROCEDURE to do a check though the table, if any of the record is older then 2weeks (14days) they shall be deleted.
I have tryed something, where i use SELECT EXTRACT YEARDAY, as i saw days was easy to work with, after that i cant get weeks out. But i have still not got any luck geting something together. If u have any idea plz reply =)

(using IB 6.0)

Thx
Gandi
 
What about:

Delete from yourtable where YourData < today - 14 Steven van Els
SAvanEls@cq-link.sr
 
yeah i have tryed that, but it doesn't work. Becasue i cant use CURRENT_DATE, i can only use CURRENT_TIMESTAMP (here i get both date and time), so when i do the -14 it takes it from the time or something, becasue it dont work. And if i try to use CURRENT_DATE it pops up the error:

SQL error code = -104
Client SQL dialect 1 does not support reference to DATE datatype

I'm using Interbase 6.0 and u dunno what it's talking about =) anyone have some ideas how to solve this ?

Thx
Gandi
 
I know that that from interbase 5 to 6 some modifications are introduced in the DateTime type, but there must be a type conversion function to extract the date part. Steven van Els
SAvanEls@cq-link.sr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top