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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create list of all dates in period?

Status
Not open for further replies.

pbb72

Programmer
Mar 27, 2004
38
NO
I've got an Access database that contains a date-related table (say for example, a record for each purchase made in a store). Now I have a group-query that counts the number of items per date, and I have an ASP.NET page that binds a table to the query result.
However, all the dates that have no purchases, are skipped in the table of course. I would like to display those days, with zero as totals on those days.

What is the best approach? Should I edit my query, or perform some actions on the returned dataset, or manually insert those dates while filling the table with the dataset?
An extra handicap is that I don't know the first and last date beforehand...
 
I would suggest inserting the records manually after the fact.

Once you have your resultset, it would be pretty simple to iterate it and insert the missing records. Trying to work that out in SQL would be considerably more difficult.

-paul

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Thanks Paul! I'm going to dive into that approach. I'm new to ASP.NET (have always been using standard ASP) but I'm sure I can solve this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top