Date Calculations

  • Thread starter Thread starter Rohit
  • Start date Start date
R

Rohit

Hi Everybody,

I have a query in Access with 3 Fields Date Received,
Tally Number, SumofCubicFeet. How can I calculate the
below scenerio:

If Data Received > 60 days then SumofCubicFeet * .15.

Can somebody please help.

Thanks
Rohit
 
I believe this may help you Rohit.

With your data:
IIf(DateDiff("d", Now, Data Received) < -60, SumofCubicFeet * .15 , PUT ELSE
CLAUSE HERE)

Can be tested in debug window:
IIf(DateDiff("d", Now, #1/1/2003#) < -60, "Date is older than 60 days",
"Date is within 60 days")

Jim Pavek
Fort Collins CO
 
Hi Everybody,

I have a query in Access with 3 Fields Date Received,
Tally Number, SumofCubicFeet. How can I calculate the
below scenerio:

If Data Received > 60 days then SumofCubicFeet * .15.

Can somebody please help.

Thanks
Rohit

A Date field *is a date* - it's actually stored as a floating point
number, a count of days and fractions of a day since midnight,
December 30, 1899. What do you mean by "Date Received > 60 days"?
Sixty days from... when? sixty days ago today, or what?

Also, what do you want to display if Date Received does not meet this
criterion? Do you just want to select those records (older than??) 60
days and ignore the rest, or display some other value? Or do you want
to change the stored value of SumOfCubicFeet?

Please clarify!
 
I have Tried the below mentioned query, but still was
not able to finish the assigned task. Again, I have a
query in Access with 4 Fields Date Received,
-----Original Message-----
I believe this may help you Rohit.

With your data:
IIf(DateDiff("d", Now, Data Received) < -60,
SumofCubicFeet * .15 , PUT ELSE
CLAUSE HERE)

Can be tested in debug window:
IIf(DateDiff("d", Now, #1/1/2003#) < -60, "Date is older than 60 days",
"Date is within 60 days")

Jim Pavek
Fort Collins CO
Sometimes it just prints the below without giving any
results-->
"[Freight Handling].IIf(DateDiff(""d"", Now,[Date
Received]) <-60, ""Date is older than 60 days"",""Date is
within 60 days"") ""Date is within 60 days"")]"
 
Back
Top