Solved

function to work with data

Posted on 2007-03-19
3
150 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Title # Comments Views Activity
How to debug For loops? 3 61
Convert a string into a TDateTime 5 72
how to resize animated Gif image in delphi ? 1 45
update joined tables 2 62
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…

749 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