Find Days Between

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

Guest

Hi,

I have a query with Sevice Dates. I want to build into my query the
difference in days between today and the Service Dates.
example - Service Date = 1-May-06
Today = 7-May-06

Difference = 7
and when i run this query tomorrow it would be 8.

How can I do this query??

Thanks,
Jez.
 
One way will be to use the DateDiff function, In the query create a new field

DayDifferent: DateDiff("d",[Service Dates],Date())

Or, you can try
DayDifferent: Date() - [Service Dates]
 
Thanks for that. It works :-)

My next problem is that I am trying to show the Days Different in groups.

How can I say if Days Different = 0-30 then Overdue1
31-60 then Overdue2
61-90 then Overdue3
91and over then Overdue4

I am new to using Access and have been used to doing all this in Excel.

Thanks,
Jez


Ofer Cohen said:
One way will be to use the DateDiff function, In the query create a new field

DayDifferent: DateDiff("d",[Service Dates],Date())

Or, you can try
DayDifferent: Date() - [Service Dates]

--
Good Luck
BS"D


Jez said:
Hi,

I have a query with Sevice Dates. I want to build into my query the
difference in days between today and the Service Dates.
example - Service Date = 1-May-06
Today = 7-May-06

Difference = 7
and when i run this query tomorrow it would be 8.

How can I do this query??

Thanks,
Jez.
 
Try something like

IIf([Days Different] <= 30, "Overdue1" , IIf([Days Different] <= 60,
"Overdue2", IIf([Days Different] <= 90 , "Overdue3","Overdue4")))
--
Good Luck
BS"D


Jez said:
Thanks for that. It works :-)

My next problem is that I am trying to show the Days Different in groups.

How can I say if Days Different = 0-30 then Overdue1
31-60 then Overdue2
61-90 then Overdue3
91and over then Overdue4

I am new to using Access and have been used to doing all this in Excel.

Thanks,
Jez


Ofer Cohen said:
One way will be to use the DateDiff function, In the query create a new field

DayDifferent: DateDiff("d",[Service Dates],Date())

Or, you can try
DayDifferent: Date() - [Service Dates]

--
Good Luck
BS"D


Jez said:
Hi,

I have a query with Sevice Dates. I want to build into my query the
difference in days between today and the Service Dates.
example - Service Date = 1-May-06
Today = 7-May-06

Difference = 7
and when i run this query tomorrow it would be 8.

How can I do this query??

Thanks,
Jez.
 
Back
Top