function to work with data

Posted on 2007-03-19
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 +


Question by:hidrau
  • 2
LVL 21

Accepted Solution

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


Author Comment

ID: 18747872
I unknew this function.

thanks very much

LVL 21

Expert Comment

ID: 18747889
you're welcome:)


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
proper way to parse text with delphi 7 101
error 1.1 400 Bad request idhttp delphi 18 54
How to debug For loops? 3 45
When i run adoquery my application freezes 26 150
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now