Date Formatting

Hi,

I wondered if anyone can tell me how to calculate the date 15 days from a date that has been calculated.

My code below works out the date 30 days from current.Monthly is a string value.

Monthly := (FormatDateTime('dd/mm/yyyy', Now + 30));

I want to work out what the date is 15 days prior to the above date and store it in a variable.
Can anyone help?

Many Thanks
HotRod40Asked:
Who is Participating?
 
kretzschmarConnect With a Mentor Commented:
yep,
your monthly-var you must reconvert to tdatetime before

look at strtodate

meikl ;-)
0
 
kretzschmarCommented:
stringvar := (FormatDateTime('dd/mm/yyyy', yourdate - 15));

0
 
HotRod40Author Commented:
When I do this I get an error: 'Incompatible Types: String and Integer.
Any more ideas.
The code Im writing is this:

Prior:='FormatDateTime('dd/mm/yyyy', Monthly - 15));

Prior is a string.

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.