×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

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.

Students Click Here

Modifying a Date Field

Modifying a Date Field

Modifying a Date Field

(OP)
How do I add a number of days/months/years to a date field.

e.g. in Access I can do the following:

Update [MyTable] set [mydate] = dateAdd('m', 2, [mydate])

This will add 2 months to all the [mydate] values.

How do I do something similar in Pervasive??

Mighty

RE: Modifying a Date Field

Hi,

I got this from the manual - hopefully it will help.

Regards,
Tom

Date Arithmetic
The SRDE supports adding or subtracting an integer from a date where the integer is the number of days to add or subtract, and the date is embedded in a vendor string. (This is equivalent to executing a convert on the date).

The SRDE also supports subtracting one date from another to yield a number of days.

Examples
SELECT * FROM person P, Class C WHERE p.Date_Of_Birth < ' 1973-09-05' and c.Start_date >{d '1995-05-08'} + 30

RE: Modifying a Date Field

(OP)
Thanks Tom - although I didn't need the convert on the date.

I simply did something like the following the following:

UPDATE "My Table" SET myDate = myDate + 365

Mighty

RE: Modifying a Date Field

Hi,

Glad I could help.  Thanks for the star.

Regards,
Tom

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! Already a Member? Login

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