Topic: Add days to a Date

Hi All,
I found the following code that I'm trying to add to my new Equipment project:
frmEquip.EqNextSvcDate.DateTime := frmService.cboSvcDate.DateTime + 60 ;
.
I like it because it's pretty simple and it works as shown however I would like to replace the 60 with the data from a field.  The field has numbers like 1, 7, 30, ...etc.
.
Is this something that can be done?
.
Thanks, Frank

Re: Add days to a Date

Yes you can.
You get the number from this field in string format. You need to use the StrToInt (field) function to convert to a number.

Re: Add days to a Date

Sparrow,
Thanks, that works great.
.
At first it didn't work because SvcInterval was already an Integer field.  I had tried to use it as is before but kept getting compatibility errors.  Maybe there was something wrong with my syntax??
.
Anyway, I changed SvcInterval to a text field, then applied the strToInt function and now everything seems to be working OK.
.
Thanks
Frank