Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

totals by date 1

Status
Not open for further replies.

mulliganradio

IS-IT--Management
Dec 14, 2001
8
US
trying to ask the question a differnet way incase the last one did not make since.

I have 2 parameters for range of dates. ?from timeframe and ?to timeframe

The table grabs events by date between the parameters above.

The problem is the table only has data in it if there was an event.

example:

?from timeframe = 4/18/2004
?to timeframe = 4/24/2004

if the the table has data for 4/19, 4/20, 4/21 it shows up with no problems. How can I get the days 4/18,4/22,4/23,4/24 to show up in the report as no records instead of not being included in the report?
 
You could create a table in your database with all possible dates, select data based on that table, and use a left-outer join to the event table.

-Gary
 
Creating a table with all dates as glalsop suggests is the best solution. But, if you can't do that, you can fill in missing dates using a method I described in thread767-526332. Instead of the "*" in those formulas, you could substitute " 0" or " No records."

-LB
 
Here's a FAQ which discusses creating a table, and provides the code for SQL Server:

faq767-4532

This is very common to reporting requirements, so coding for it manually in each instance should try to be avoided.

Otherwise something like LB's solution might suit you.

The real problem is that you need to fabricate data, this isn't a limitation of Crystal nor a limitation of your database product, it's a design flaw in your reporting process.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top