datediff question

  • Thread starter Thread starter Harold Ducote
  • Start date Start date
H

Harold Ducote

I'm running a query to tell me the total number of days which is Sum((DateDiff("d",[ddate],[return_date])))

how can i limit the answer to calculate just past 30 days, 60 days and not the total number of days
 
Most potential respondents will ignore posts with attachments.

Repost WITHOUT attachments and with appropriate details, e.g. which date do
you want to be in the last 30 days. Remember, we don't see your database.

--
HTH
Van T. Dinh
MVP (Access)




I'm running a query to tell me the total number of days which is
Sum((DateDiff("d",[ddate],[return_date])))

how can i limit the answer to calculate just past 30 days, 60 days and not
the total number of days
 
the past 30 days. or 60 days, so it would be from today -30 days ago, during that period.

Most potential respondents will ignore posts with attachments.

Repost WITHOUT attachments and with appropriate details, e.g. which date do
you want to be in the last 30 days. Remember, we don't see your database.

--
HTH
Van T. Dinh
MVP (Access)




I'm running a query to tell me the total number of days which is
Sum((DateDiff("d",[ddate],[return_date])))

how can i limit the answer to calculate just past 30 days, 60 days and not
the total number of days
 
Not exactly sure what your question is. Do you want to return values from the
calculation that are in even 30 day increments?

30 * (Sum((DateDiff("d",[ddate],[return_date])))\30)

That will give you
zero for 0-29 days
30 for 30 to 59 days
60 for 60 to 89 days
...

Is that what you want? Or are you trying to get some other results? You may
need to restate your question and give us some examples of the data you have and
the result you want to see.


I'm running a query to tell me the total number of days which is Sum((DateDiff("d",[ddate],[return_date])))

how can i limit the answer to calculate just past 30 days, 60 days and not the
total number of days
 
no what i want to see all the equipment rented in the past 30, 60, 90 etc days with number of days rented during that time, for example serial number 1 in the past 30 days rented 15, but in the last 60 days it rented 45.

something i guest like from today back 30, 60, 90 days, in the query.


Not exactly sure what your question is. Do you want to return values from the
calculation that are in even 30 day increments?

30 * (Sum((DateDiff("d",[ddate],[return_date])))\30)

That will give you
zero for 0-29 days
30 for 30 to 59 days
60 for 60 to 89 days
...

Is that what you want? Or are you trying to get some other results? You may
need to restate your question and give us some examples of the data you have and
the result you want to see.


I'm running a query to tell me the total number of days which is Sum((DateDiff("d",[ddate],[return_date])))

how can i limit the answer to calculate just past 30 days, 60 days and not the
total number of days
 

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

Back
Top