Solved

function to work with data

Posted on 2007-03-19
3
148 Views
Last Modified: 2010-04-04
Hello guys

I need a function for delphi 5 that I can sum days, months or years. Something like dateadd of mssql.

Something like this way:

dateadd(data: tdatetime; type: string; value: integer): Tdatetime;

type = 'mm','dd','yy'

Data: is the original date
it type = 'mm' only the month will have to be add and so on
value = the value to add

this function must be work with - and +

thanks



0
Comment
Question by:hidrau
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
ziolko earned 500 total points
ID: 18747732
SysUtils.IncMonth()
to add day simply add 1 to datetime
to add year IncMonth(, 12)

ziolko.
0
 
LVL 1

Author Comment

by:hidrau
ID: 18747872
I unknew this function.

thanks very much

0
 
LVL 21

Expert Comment

by:ziolko
ID: 18747889
you're welcome:)

ziolko.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question