Solved

function to work with data

Posted on 2007-03-19
3
142 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
Comment Utility
SysUtils.IncMonth()
to add day simply add 1 to datetime
to add year IncMonth(, 12)

ziolko.
0
 
LVL 1

Author Comment

by:hidrau
Comment Utility
I unknew this function.

thanks very much

0
 
LVL 21

Expert Comment

by:ziolko
Comment Utility
you're welcome:)

ziolko.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

12 Experts available now in Live!

Get 1:1 Help Now