15 replies
by dklippert
Try:
DateDiff("d", [RTDDate], [FURDate]).
by bambamz
This didn't work. If I only put this formula then it gives me an error unexpected something or other. Does it make a difference that the formula and fields are in the sub form? If my two date fields are in date format what format should the total field be in?
by techrep
RTDDate and FURDate definitely should not be in quotes. If you are working with a form, try this:
CtlTotal = DateDiff("D", Form.RTDDate, Form.FURDate)
Or for a report:
CtlTotal = DateDiff("D", Report.RTDDate, Report.FURDate)
by bambamz
Does it make a difference that the formula and fields are in the sub form? If my two date fields are in date format what format should the total field be in?
by adasys
try this:
dim ctltotal
ctltotal=datediff("d",rtddate,furdate)
Make sure both dates does not have a null value
by bambamz
Oh darn this didn't work either.
by adasys
Ithing you have not yet open your db file.
try this again in vbs.
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "yourdata.mdb" 'paths are acceptable
set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select * from table_name", conn
dim ctlTotal
ctlTotal = datediff("d",rs("RTDDATE"),rs("FURDATE"))
wscript.echo ctltotal
by bambamz
This probably makes sense but it is way over my head. Are you saying put this in before I open the database? how would I do this? I have the forms open and input this in the FURDate field after update as an event procedure.
by bambamz
by adasys
Please give me some of the details of your form.
Where does FURDATE and RTDDATE came from.
If you say there are the field names how is it being save there? Is it via form?
the you better calculate it from the form.objectname before you save the ctltotal then.
by bambamz
I have a table on a server then I have the front end forms on the hard drive. I link the tables to the forms. Then I created the main form and then a subform on the main form. The sub form is linked by the SSN and I may have multiple dates for FURDate and RTDDate and then I need to know the total. So I am trying to input he formula on the subform where it calls these fields and the total field is on the same sub form and same table.
by lawkaanat
try this;
CtlTotal=DateDiff("y",[RTDDate],[FURDate])
by bambamz
i am so sorry to day that this did not work either. I don't know what I am missing.
by bambamz
by bambamz
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending