INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Syntax for date operations

Syntax for date operations

(OP)
I want to delete rows with a date older than x days (where x is taken from a config file). In Oracle I would do

delete from table where thedate < sysdate - 35; -- if x = 35

What is the syntax i Mimer?

RE: Syntax for date operations

Hej Peter

I Mimer har man Date och intervall data type.

Man kan skriva på följande sätt:


SELECT DATE '1994-11-03' + INTERVAL'10' DAY(5) FROM MIMER.ONEROW;

SELECT (CURRENT_DATE - DATE '1999-11-03') DAY(5) FROM MIMER.ONEROW;

select localtimestamp - interval '1-6' year to month  from mimer.onerow;

select  localtime  - interval  '1:30' hour to minute from mimer.onerow;

Look at the documentation in

http://developer.mimer.com/features/feature_13.htm

http://developer.mimer.com/documentation/html_82/Mimer_SQL_Reference_Manual/Mimer_SQL_Reference_Manual.htm

/Paule

RE: Syntax for date operations

(OP)
Thanks,

this worked for me, removed all rows older than 200 days:

delete from table where thedate < (current_date - interval '200' day(5));

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close