Formula Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table with a Colum labeled "date arrived" and "date returned." I
have an empty colum with "Number of Days." How do I make number of days
automatically populated useing the other two fields.

Everytime I try and add a formula to the cells I get an error: "The Value
you entered isn't valid for this field.

Thank you.
 
I have a table with a Colum labeled "date arrived" and "date returned." I
have an empty colum with "Number of Days." How do I make number of days
automatically populated useing the other two fields.

Everytime I try and add a formula to the cells I get an error: "The Value
you entered isn't valid for this field.

Thank you.

Not only you should not do this in a table, you cannot do this in a
table.

Here is one way to get the NumberOfDays difference.
Create a query.
Include the fields you need, but NOT the "number of days" field (that
field should be deleted from the table).
Add a new column:
NumberOfDays:DateDiff("d",[DateArrived],[DateReturned])

You can use this new field in any report.

Or you can, in a Form or in a Report, add an unbound control to the
form/report.
Set it's control source to:
=DateDiff("d",[DateArrived],[DateReturned])

Again, this calculated control should not be saved in any table.
Whenever you need the data, re-calculate it.
 
thank you...you rock

fredg said:
I have a table with a Colum labeled "date arrived" and "date returned." I
have an empty colum with "Number of Days." How do I make number of days
automatically populated useing the other two fields.

Everytime I try and add a formula to the cells I get an error: "The Value
you entered isn't valid for this field.

Thank you.

Not only you should not do this in a table, you cannot do this in a
table.

Here is one way to get the NumberOfDays difference.
Create a query.
Include the fields you need, but NOT the "number of days" field (that
field should be deleted from the table).
Add a new column:
NumberOfDays:DateDiff("d",[DateArrived],[DateReturned])

You can use this new field in any report.

Or you can, in a Form or in a Report, add an unbound control to the
form/report.
Set it's control source to:
=DateDiff("d",[DateArrived],[DateReturned])

Again, this calculated control should not be saved in any table.
Whenever you need the data, re-calculate it.
 
Any chance you would also know how to calculate the number of items linked to
one contact?

fredg said:
I have a table with a Colum labeled "date arrived" and "date returned." I
have an empty colum with "Number of Days." How do I make number of days
automatically populated useing the other two fields.

Everytime I try and add a formula to the cells I get an error: "The Value
you entered isn't valid for this field.

Thank you.

Not only you should not do this in a table, you cannot do this in a
table.

Here is one way to get the NumberOfDays difference.
Create a query.
Include the fields you need, but NOT the "number of days" field (that
field should be deleted from the table).
Add a new column:
NumberOfDays:DateDiff("d",[DateArrived],[DateReturned])

You can use this new field in any report.

Or you can, in a Form or in a Report, add an unbound control to the
form/report.
Set it's control source to:
=DateDiff("d",[DateArrived],[DateReturned])

Again, this calculated control should not be saved in any table.
Whenever you need the data, re-calculate it.
 
Any chance you would also know how to calculate the number of items linked to
one contact?

fredg said:
I have a table with a Colum labeled "date arrived" and "date returned." I
have an empty colum with "Number of Days." How do I make number of days
automatically populated useing the other two fields.

Everytime I try and add a formula to the cells I get an error: "The Value
you entered isn't valid for this field.

Thank you.

Not only you should not do this in a table, you cannot do this in a
table.

Here is one way to get the NumberOfDays difference.
Create a query.
Include the fields you need, but NOT the "number of days" field (that
field should be deleted from the table).
Add a new column:
NumberOfDays:DateDiff("d",[DateArrived],[DateReturned])

You can use this new field in any report.

Or you can, in a Form or in a Report, add an unbound control to the
form/report.
Set it's control source to:
=DateDiff("d",[DateArrived],[DateReturned])

Again, this calculated control should not be saved in any table.
Whenever you need the data, re-calculate it.

In an unbound control:
=DCount("*","TableName","[SomeField] = SomeCriteria")

You'll need to do some homework to make the above work.
Look Up DCount in VBA Help.
Also Where Clause + Restrict data to a subset of records"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top