Null records with Between operator

A

alphamisanthrope

I am slowly becoming homicidal. I've been messing with this on and off
for two days now. Please, y'all help if possible.

I have two tables. tblStay, tblTime

tblStay has two colums: timeIn, timeOut
tblTime has one column a list of every hour.

Here's my query:
SELECT tblTime.Hour, Count(*) AS HowMany
FROM tblStay, tblTime
WHERE tblTime.Hour Between [tblStay].[TimeIn] And [tblStay].[TimeOut]
GROUP BY tblTime.Hour;

I've tried placing an Nz function damn near everywhere, and a couple
of If IsNull statements, but I, for the life of me, cannot get a zero
to return.

Please help.
 
M

Marshall Barton

alphamisanthrope said:
I am slowly becoming homicidal. I've been messing with this on and off
for two days now. Please, y'all help if possible.

I have two tables. tblStay, tblTime

tblStay has two colums: timeIn, timeOut
tblTime has one column a list of every hour.

Here's my query:
SELECT tblTime.Hour, Count(*) AS HowMany
FROM tblStay, tblTime
WHERE tblTime.Hour Between [tblStay].[TimeIn] And [tblStay].[TimeOut]
GROUP BY tblTime.Hour;

I've tried placing an Nz function damn near everywhere, and a couple
of If IsNull statements, but I, for the life of me, cannot get a zero
to return.


I think I answered this question in another newsgroup.

Please don't post the same question multiple times.
 
A

alphamisanthrope

You did. I'm sorry about that. I not on my ususal machine and I kept
getting all kinds of error pop-ups. I fixed it.

Thanks, again
 

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