IIf statement with "and" for tables with no relationship

M

margaret

I have two tables ... redemption and sold. In the sold table, I have three
fields serialopen, serialclose, and fairdate. In redemption, I have serial.

Example of sold:

Serialopen -- c1000; serialclose c1999; fairdate 10/15/2004

Example of redemption

serial --- c1750

I need to figure out if serial falls with in the serialopen and serialclose
and return the fairdate. My statement is: SoldDate:
IIf(([serial]>=[serialopen] And [serial]<=[serialclose]),[fairdate],Null)

Since I have no absolute relationship between these two tables, how do I go
about running the query?

thanks for any help.
 
K

KARL DEWEY

Try this on your data --
SELECT redemption.serial, Sold.fairdate
FROM redemption, Sold
WHERE (((redemption.serial) Between [serialopen] And [serialclose]));
 
M

margaret

That worked ... thanks for your help

KARL DEWEY said:
Try this on your data --
SELECT redemption.serial, Sold.fairdate
FROM redemption, Sold
WHERE (((redemption.serial) Between [serialopen] And [serialclose]));

--
KARL DEWEY
Build a little - Test a little


margaret said:
I have two tables ... redemption and sold. In the sold table, I have three
fields serialopen, serialclose, and fairdate. In redemption, I have serial.

Example of sold:

Serialopen -- c1000; serialclose c1999; fairdate 10/15/2004

Example of redemption

serial --- c1750

I need to figure out if serial falls with in the serialopen and serialclose
and return the fairdate. My statement is: SoldDate:
IIf(([serial]>=[serialopen] And [serial]<=[serialclose]),[fairdate],Null)

Since I have no absolute relationship between these two tables, how do I go
about running the query?

thanks for any help.
 

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