OK, let's get technical.
Here's the table structure
"ID" int 4, key
"DateRecorded" DateTime
"Location" VarChar 64
The report is counting "hits per day" regardless of location.
Here's some possible data
7683 12/10/2003 4:10:20 Kitchen
7684 12/10/2003 7:55:12 Laundry Room
7685 12/10/2003 14:34:02 Patio
7686 12/11/2003 5:02:56 Kitchen
7687 12/13/2003 9:00:49 Patio
7688 12/14/2003 12:30:00 Back Door
Notice there's no data collected for 12/12/2003. How does 0-data go in?
How will the report be smart enough to make it a 0 for 12/12? If I enter a
row like "7689 12/12/2003 00:00:01 0", it's going to report a "hit" (1) for
the 12th when there shouldn't be anything. It's the Crystal Report that is
grouping by day a count, not any t-sql.
There must be a setting in CR, that tells it to "pad" days with 0 counts.
"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn***************************@140.99.99.130.. .
"i. Wiin" <ii****@yagoo.com> wrote in
news:e9*************@TK2MSFTNGP14.phx.gbl:
How do I generate 0 data for missing days? SQL clause that builds the
DataSet that the report is based off of is "SELECT * FROM table WHERE
table.daterecorded BETWEEN '1/1/2002' AND '6/30/2002'" then Crystal
breaks up the groups by day and displays a count of rows for that day.
How Do I Create A 0 Row For A Day If The Criteria Is Count Of Rows
Per Day?
You'll need to write a SQL while loop to insert blank data. Time for you
to learn T-SQL!
OR... if you're binding a dataset to the report, you can loop through the
dataset and pad with 0-data.
Try microsoft.public.sqlserver.programming for more info.
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/