Query using date information

J

jgoudy

I have a 90 day period of time that I need quarter hour sales data for. The
problem is that if there are no sales, I don't get a 0 value the table just
skips that time period. I can't touch the table but would like to somehow
create a query that realizes I am missing that quarter hour and automatically
fill in a 0 value. I have a table with the quarter hours and another query
that brings back the time period (either midnight to midnight or 9am to 9pm,
whatever the criteria is) along with the date range. Is this even possible?
Thanks for any help,
Jen
 
P

pietlinden

I have a 90 day period of time that I need quarter hour sales data for. The
problem is that if there are no sales, I don't get a 0 value the table just
skips that time period. I can't touch the table but would like to somehow
create a query that realizes I am missing that quarter hour and automatically
fill in a 0 value.  I have a table with the quarter hours and another query
that brings back the time period (either midnight to midnight or 9am to 9pm,
whatever the criteria is) along with the date range.  Is this even possible?  
Thanks for any help,
Jen

You need a table of time periods. (Set it up with one field, say
TimePeriod, and then populate it by opening a recordset against it and
appending records.

Once you have that, you can outer join that (that would be the "show
all" side) to the data table you have, and it would record zeroes for
time frames with no sales.
 
J

jgoudy

Thanks for the response. Do I need a table with time periods for each day of
the year though? Not sure how to do this part really. Thanks again,
Jen
 

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