IF statement in Access ?

L

lil lam

Hi,

I've been using the IF statements in EXCEL.
Now I need it to work for Access 2007.

Here is what I am working with:

I have 2 columns with dates.
I want to compare the two columns and have access give me the oldest
date.
Once I get the oldest date, i want to update it into another table.

Can anyone help?
 
J

Jeff Boyce

It sounds like you are trying to make Access work like Excel. Access is a
relational database.

If you feed it 'sheet data, you and Access will have to work overtime to
come up with work-arounds.

This is a "pay now or pay later" situation. You can pay now by learning the
way Access expects to see data (and is optimized to handle), or you can pay
later by continually maintaining and modifying your Access database.

If you picked up a chainsaw after learning to use a hammer, would you expect
to use the chainsaw the same way you used the hammer? No doubt, you could,
but would it be a good idea?

Spend some time brushing up on relational database design and normalization
before you proceed.

JOPO (just one person's opinion)

Regards

Jeff Boyce
Microsoft Access MVP


--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
K

Keven Denen

Hi,

I've been using the IF statements in EXCEL.
Now I need it to work for Access 2007.

Here is what I am working with:

I have 2 columns with dates.
I want to compare the two columns and have access give me the oldest
date.
Once I get the oldest date, i want to update it into another table.

Can anyone help?

Assuming bdate and cdate are your two date fields; IIf([bdate]<[cdate],
[bdate],[cdate])

You can use this in a query to show whichever date is the oldest. The
wisdom of storing that value in a different table is another issue,
but I'll leave that to your discretion.

Keven
 

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