Wrox Programmer Forums
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 24th, 2005, 04:06 PM
Registered User
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with Date Range

At work we have a database with 2 relevant columns: An account number and a day that account was approved. I'm designing a query that for a given date range, will give the number of accounts approved on EACH day in that range. Simple enough. Problem is, EVERY day in the range needs to appear, whether there were any accounts approved on that day or not. I can't figure out a function to get the entire range. The end result should look like this

Date Accts_Approved
12/1/4 3
12/2/4 0 (or blank is fine,also)
12/3/4 7

as it is now, I'm just Counting accts by Date and it would look like this:

Date Accts_Approved
12/1/4 3
12/3/4 7

Old February 1st, 2005, 12:30 PM
ru1 ru1 is offline
Authorized User
Join Date: Feb 2005
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts

Ok Bud, time to start thinking 4th dimensional. This is what you need to do: I am going to describe it and if you need further help, coding it let me know. Here goes:

Start by using the beginning date and ending date to build a temporary table that will have all the date slots in it whether you use them or not.

Next, take the dates that you do have and go populate your temp table. After this, you now can run your report against the temp table with the complete slots. When you close your report, delete all recs in the temp table.

You can run a query against this temp table instead of a report if you need this for a query as well.

Hope this helps.


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find a date range between another date rang tayvonne Access 2 August 3rd, 2006 09:50 AM
Date Range Flipflop SQL Language 6 November 25th, 2005 08:36 AM
Need Help With Date Range rpainter Crystal Reports 0 June 20th, 2005 01:01 PM
Date Range mrideout BOOK: Beginning ASP.NET 1.0 0 January 2nd, 2005 07:18 PM
Query with a date range... PLEASE HELP! tlcable7 Access ASP 2 October 1st, 2003 03:41 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.