Average Days

  • Thread starter Thread starter Charles Phillips
  • Start date Start date
C

Charles Phillips

Hello,
I have a form in MS-Access 2003, that has 2 date field.

1. Date Survey Sent
2. Date Received Survey Response

I maybe stating this wrong, so please forgive me.
I want to calculate the time [day(s)] between the 2 listed date fields.
I want to find the average day(s) between the 2 date fields listed, for a
group of survey takers.
Can/will someone point me to some examples/samples???


Thank you,


Charles L. Phillips
 
hi,

You can use the DateDiff function to return the difference between the 2
dates:

SELECT tbl_name.dated, tbl_name.dated2, Avg(DateDiff('d',[dated],[dated2]))
AS difference
FROM tbl_name
GROUP BY tbl_name.dated, tbl_name.dated2;

The preceding gives the number of days between dated and dated2, in the
[difference] column of the query.

hope this helps,
geebee
 
The days between the two days can be calculated using DateDiff() or simply:
[ResponseDate]-[SentDate]
The average is: Avg([ResponseDate]-[SentDate])
It sounds like you don't want a formula for a control but rather a totals
query:
Group By SurveyTakerGroup
Avg ([ResponseDate]-[SentDate])

Charles said:
Hello,
I have a form in MS-Access 2003, that has 2 date field.

1. Date Survey Sent
2. Date Received Survey Response

I maybe stating this wrong, so please forgive me.
I want to calculate the time [day(s)] between the 2 listed date fields.
I want to find the average day(s) between the 2 date fields listed, for a
group of survey takers.
Can/will someone point me to some examples/samples???

Thank you,

Charles L. Phillips
 
Hello,
This looks like what I need.
I'll try this out this weekend & get back to you...


Thank you,

Charles L. Phillips


geebee said:
hi,

You can use the DateDiff function to return the difference between the 2
dates:

SELECT tbl_name.dated, tbl_name.dated2,
Avg(DateDiff('d',[dated],[dated2]))
AS difference
FROM tbl_name
GROUP BY tbl_name.dated, tbl_name.dated2;

The preceding gives the number of days between dated and dated2, in the
[difference] column of the query.

hope this helps,
geebee

Charles Phillips said:
Hello,
I have a form in MS-Access 2003, that has 2 date field.

1. Date Survey Sent
2. Date Received Survey Response

I maybe stating this wrong, so please forgive me.
I want to calculate the time [day(s)] between the 2 listed date fields.
I want to find the average day(s) between the 2 date fields listed, for a
group of survey takers.
Can/will someone point me to some examples/samples???


Thank you,


Charles L. Phillips
 
Hello,
This looks like what I need too.
Your code looks similar to "geebee's".
I'll try this out this weekend & get back to you too...


Thank you,

Charles L. Phillips

kingston via AccessMonster.com said:
The days between the two days can be calculated using DateDiff() or
simply:
[ResponseDate]-[SentDate]
The average is: Avg([ResponseDate]-[SentDate])
It sounds like you don't want a formula for a control but rather a totals
query:
Group By SurveyTakerGroup
Avg ([ResponseDate]-[SentDate])

Charles said:
Hello,
I have a form in MS-Access 2003, that has 2 date field.

1. Date Survey Sent
2. Date Received Survey Response

I maybe stating this wrong, so please forgive me.
I want to calculate the time [day(s)] between the 2 listed date fields.
I want to find the average day(s) between the 2 date fields listed, for a
group of survey takers.
Can/will someone point me to some examples/samples???

Thank you,

Charles L. Phillips
 
Hello,
geebee and kingston, I want to "Thank You" for your help.
Both suggestions worked fine. After doing some "homework", I went with the
following:

Response Time In Days: =DateDiff("d",[DateSent],[DateResponded])

Now I need to mark the days.
If the response time is less than or equal to 5 days, I want a "black"
background and "green" text, for my text box.
If the response time is greater than 5 days, I want a "black" background and
"red" text, for my text box.
Can/will someone point me to some examples/samples, for this???


Thank you,

Charles L. Phillips




Charles Phillips said:
Hello,
This looks like what I need too.
Your code looks similar to "geebee's".
I'll try this out this weekend & get back to you too...


Thank you,

Charles L. Phillips

kingston via AccessMonster.com said:
The days between the two days can be calculated using DateDiff() or
simply:
[ResponseDate]-[SentDate]
The average is: Avg([ResponseDate]-[SentDate])
It sounds like you don't want a formula for a control but rather a totals
query:
Group By SurveyTakerGroup
Avg ([ResponseDate]-[SentDate])

Charles said:
Hello,
I have a form in MS-Access 2003, that has 2 date field.

1. Date Survey Sent
2. Date Received Survey Response

I maybe stating this wrong, so please forgive me.
I want to calculate the time [day(s)] between the 2 listed date fields.
I want to find the average day(s) between the 2 date fields listed, for a
group of survey takers.
Can/will someone point me to some examples/samples???

Thank you,

Charles L. Phillips
 
Back
Top