A calculated field in access

C

Candy Pierce

I need an Expression to extend the purchase date to a warranty expiration
date based on a product type
 
J

John W. Vinson

I need an Expression to extend the purchase date to a warranty expiration
date based on a product type

Ummmm....

How can we help?

You have not chosen to post any information about the structure of your table,
where the purchase date is stored, how you intend to identify the extension...

Give us a hand here please?
 
C

Candy Pierce

Here is the problem that I am working on in access:

Create a Select Query with Calculations
Standard operating procedure for purchasing desktop and notebook computers
is to buy three-year extended next-business-day warranties for notebooks and
two-year next-business-day warranties for all desktops. The warranty
effective dates are the purchase dates. You want to calculate the warranty
expiration dates for the computers in the Hardware table.

• Create a query on the Hardware table named WarrantyExpiration with asset
tag, product type, purchase date, and employee ID.
• Create a calculated field to extend the purchase date to a warranty
expiration date based on product type.
• Return the results in a column named Warranty Expiration. Sort by nearest
expiration dates.
• Run and save the query


I created a query on the Hardware Table named WarrantyExpiration with asset
tag, product type, purchase date, employee ID. I created a calculated field
to extend the purchase date to a warranty expiration date based on th product
type. I used the IIf function and the Dateserial in the Builder to get my
expression. The DateSerial works good, until, I try to use the IIf to
associate it with the ProductType: "Desktop" Or "Notebook/tablet",
 
K

KARL DEWEY

Why not use DateAdd and IIF like this --
Expiration: DateAdd("yyyy", IIF([ProductType] = "DeskTop", 2, 3),
[PurchaseDate])
 
J

John W. Vinson

Create a Select Query with Calculations
Standard operating procedure for purchasing desktop and notebook computers
is to buy three-year extended next-business-day warranties for notebooks and
two-year next-business-day warranties for all desktops. The warranty
effective dates are the purchase dates. You want to calculate the warranty
expiration dates for the computers in the Hardware table.

Sorry, this appears to be YOUR homework, not mine.
 
C

Candy Pierce

I had tried to used the IIF and the DateSerial, but I could not get it to
work .After seeing this Expression. I now know that I had one to many )))), I
removed one) and now it works fine. Thank you!
--
Candy Pierce


KARL DEWEY said:
Why not use DateAdd and IIF like this --
Expiration: DateAdd("yyyy", IIF([ProductType] = "DeskTop", 2, 3),
[PurchaseDate])

--
Build a little, test a little.


Candy Pierce said:
Here is the problem that I am working on in access:

Create a Select Query with Calculations
Standard operating procedure for purchasing desktop and notebook computers
is to buy three-year extended next-business-day warranties for notebooks and
two-year next-business-day warranties for all desktops. The warranty
effective dates are the purchase dates. You want to calculate the warranty
expiration dates for the computers in the Hardware table.

• Create a query on the Hardware table named WarrantyExpiration with asset
tag, product type, purchase date, and employee ID.
• Create a calculated field to extend the purchase date to a warranty
expiration date based on product type.
• Return the results in a column named Warranty Expiration. Sort by nearest
expiration dates.
• Run and save the query


I created a query on the Hardware Table named WarrantyExpiration with asset
tag, product type, purchase date, employee ID. I created a calculated field
to extend the purchase date to a warranty expiration date based on th product
type. I used the IIf function and the Dateserial in the Builder to get my
expression. The DateSerial works good, until, I try to use the IIf to
associate it with the ProductType: "Desktop" Or "Notebook/tablet",
 

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