Counting days elapsed

B

blake7

Hi, I have a form that is showing the results from a query, the form shows
'reported date' and 'review date' fields, i would like to show how many days
have elasped between the two dates, do i
1) Just place a text box on the form and write some expression to display
this ? if so how
2) Do i redesign the original query - how
3) Do i add an additional field to the original table - then what !!!! ?

Help please. Tony
 
F

fredg

Hi, I have a form that is showing the results from a query, the form shows
'reported date' and 'review date' fields, i would like to show how many days
have elasped between the two dates, do i
1) Just place a text box on the form and write some expression to display
this ? if so how
2) Do i redesign the original query - how
3) Do i add an additional field to the original table - then what !!!! ?

Help please. Tony

You can do it either in #1 or #2 below, NOT in #3.

In an UNBOUND text control on your form or report:
=DateDiff("d",[ReportedDate],[ReviewedDate])

In a query:
DaysElapsed:DateDiff("d",[ReportedDate],[ReviewedDate])

You could then show this new query field in your form or report, using
[DaysElapsed] as the control's control source.
 
W

Wayne-I-M

Hi

People have different ideas but I would add a calculated column to the query
so you can simply use in other things likes a report or an other query

DaysElapsed:DateDiff("d", [TableName]![Date1], [TableName]![Date2])

Or if you will never need it then just add an unbound text ox to your form
with this control source
=DateDiff("d", [Date1],[Date2])
 
B

blake7

Thanks, they both work fine, can you get the calc to ignore Sat & Sundays ?

Tony

Wayne-I-M said:
Hi

People have different ideas but I would add a calculated column to the query
so you can simply use in other things likes a report or an other query

DaysElapsed:DateDiff("d", [TableName]![Date1], [TableName]![Date2])

Or if you will never need it then just add an unbound text ox to your form
with this control source
=DateDiff("d", [Date1],[Date2])



--
Wayne
Manchester, England.



blake7 said:
Hi, I have a form that is showing the results from a query, the form shows
'reported date' and 'review date' fields, i would like to show how many days
have elasped between the two dates, do i
1) Just place a text box on the form and write some expression to display
this ? if so how
2) Do i redesign the original query - how
3) Do i add an additional field to the original table - then what !!!! ?

Help please. Tony
 
F

fredg

Thanks, they both work fine, can you get the calc to ignore Sat & Sundays ?

Tony

Wayne-I-M said:
Hi

People have different ideas but I would add a calculated column to the query
so you can simply use in other things likes a report or an other query

DaysElapsed:DateDiff("d", [TableName]![Date1], [TableName]![Date2])

Or if you will never need it then just add an unbound text ox to your form
with this control source
=DateDiff("d", [Date1],[Date2])

--
Wayne
Manchester, England.

blake7 said:
Hi, I have a form that is showing the results from a query, the form shows
'reported date' and 'review date' fields, i would like to show how many days
have elasped between the two dates, do i
1) Just place a text box on the form and write some expression to display
this ? if so how
2) Do i redesign the original query - how
3) Do i add an additional field to the original table - then what !!!! ?

Help please. Tony

Why didn't you include this question in the original post?
And what about holidays? Do you wish to exclude them or include them
in the count?
 
B

blake7

Having trouble again, i have done a unbound text box which works fine, but i
designed a query with a calculated column, but when i run it it just asks for
about three different inputs etc starting with "d", which is in the datediff
string ???

I must be doing something wrong

fredg said:
Thanks, they both work fine, can you get the calc to ignore Sat & Sundays ?

Tony

Wayne-I-M said:
Hi

People have different ideas but I would add a calculated column to the query
so you can simply use in other things likes a report or an other query

DaysElapsed:DateDiff("d", [TableName]![Date1], [TableName]![Date2])

Or if you will never need it then just add an unbound text ox to your form
with this control source
=DateDiff("d", [Date1],[Date2])

--
Wayne
Manchester, England.

:

Hi, I have a form that is showing the results from a query, the form shows
'reported date' and 'review date' fields, i would like to show how many days
have elasped between the two dates, do i
1) Just place a text box on the form and write some expression to display
this ? if so how
2) Do i redesign the original query - how
3) Do i add an additional field to the original table - then what !!!! ?

Help please. Tony

Why didn't you include this question in the original post?
And what about holidays? Do you wish to exclude them or include them
in the count?
 
B

blake7

Having trouble again, i have done a unbound text box which works fine, but i
designed a query with a calculated column, but when i run it it just asks for
about three different inputs etc starting with "d", which is in the datediff
string ???

I must be doing something wrong



Wayne-I-M said:
Hi

People have different ideas but I would add a calculated column to the query
so you can simply use in other things likes a report or an other query

DaysElapsed:DateDiff("d", [TableName]![Date1], [TableName]![Date2])

Or if you will never need it then just add an unbound text ox to your form
with this control source
=DateDiff("d", [Date1],[Date2])



--
Wayne
Manchester, England.



blake7 said:
Hi, I have a form that is showing the results from a query, the form shows
'reported date' and 'review date' fields, i would like to show how many days
have elasped between the two dates, do i
1) Just place a text box on the form and write some expression to display
this ? if so how
2) Do i redesign the original query - how
3) Do i add an additional field to the original table - then what !!!! ?

Help please. Tony
 
B

blake7

blake7 said:
Having trouble again, i have done a unbound text box which works fine, but i
designed a query with a calculated column, but when i run it it just asks for
about three different inputs etc starting with "d", which is in the datediff
string ???

Entered as below in the field area, upon click away is shows Expr1

=dateDiff("d",[Forms]![Main issue entry sheet]![Date Reported],[forms]!Main
issue entry sheet]![Todays Date])
I must be doing something wrong



Wayne-I-M said:
Hi

People have different ideas but I would add a calculated column to the query
so you can simply use in other things likes a report or an other query

DaysElapsed:DateDiff("d", [TableName]![Date1], [TableName]![Date2])

Or if you will never need it then just add an unbound text ox to your form
with this control source
=DateDiff("d", [Date1],[Date2])



--
Wayne
Manchester, England.



blake7 said:
Hi, I have a form that is showing the results from a query, the form shows
'reported date' and 'review date' fields, i would like to show how many days
have elasped between the two dates, do i
1) Just place a text box on the form and write some expression to display
this ? if so how
2) Do i redesign the original query - how
3) Do i add an additional field to the original table - then what !!!! ?

Help please. Tony
 

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

Top