A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date Groups



 
 
Thread Tools Display Modes
  #1  
Old June 26th, 2008, 07:16 PM posted to microsoft.public.access.queries
justin
external usenet poster
 
Posts: 217
Default Date Groups

I'm creating a report for total sales. The user will enter the date range
and time period (days, weeks, months, years) for the grouping. This all
works fine. I would like to display a time period even when no data exists.


I have
01/08 10
02/08 11
03/08 7
05/08 15

I want
01/08 10
02/08 11
03/08 7
04/08 0
05/08 15

Any assistance will be apreciated

  #2  
Old June 26th, 2008, 09:40 PM posted to microsoft.public.access.queries
Michel Walsh
external usenet poster
 
Posts: 2,404
Default Date Groups

You can use VBA code in the report. Keep the last date you printed in a
local variable. When it is time to print a new record (ordered by ascending
value of date) print previousDate + 1 as long as the previous date +1 is not
equal to the actual date to be printed. You can print a detail section
without moving to the 'next' record by setting the property NextRecord to
false (while leaving the properties MoveLayout and PrintSection to true).
See Access 2000 Developers' Handbook, chapter 9, pp 684-next for more
details.


Alternatively, use a driver table, such as Iotas, one field, its primary
key, iota, with values from 0 to, say, 999. Then, print on the query:

SELECT DMin("dates", "tableNameHere") + iota
FROM iotas
WHERE iota = DMax("dates", "tableNameHere") - DMin("dates",
"tableNameHere")


which should produce all the dates ( as long as there is less than 999 days
to be printed, if your table iotas stops at 999 ).



Hoping it may help,
Vanderghast, Access MVP



"Justin" wrote in message
...
I'm creating a report for total sales. The user will enter the date range
and time period (days, weeks, months, years) for the grouping. This all
works fine. I would like to display a time period even when no data
exists.


I have
01/08 10
02/08 11
03/08 7
05/08 15

I want
01/08 10
02/08 11
03/08 7
04/08 0
05/08 15

Any assistance will be apreciated



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:12 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.