Solved

function to work with data

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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

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…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

773 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