0

I have an event table with fields:

  • Event_Name
  • Event_StartDate
  • Event_EndDate

Table Data:

  • Event1, 1.1.2017, 5.1.2017
  • Event2, 3.1.2017, 5.1.2017
  • Event3, 12.1.2017, 14.1.2017

I do need a calendar query, which returns events for every day:

  • Event1, 1.1.2017
  • Event1, 2.1.2017
  • Event1, 3.1.2017
  • Event1, 4.1.2017
  • Event1, 5.1.2017
  • Event2, 3.1.2017
  • Event2, 4.1.2017
  • Event2, 5.1.2017
  • Event3, 12.1.2017
  • Event3, 13.1.2017
  • Event3, 14.1.2017

How can I do this ?

Thank you in advance, Duski

YowE3K
  • 23,852
  • 7
  • 26
  • 40
Duski
  • 25
  • 5
  • 1
    You should be able to adapt the solution provided here: http://stackoverflow.com/questions/12890967/show-all-dates-data-between-two-dates-if-no-row-exists-for-particular-date-then Or you could create a new table that has all the dates you want and join to that. – Wayne G. Dunn May 15 '17 at 17:46
  • Thank you for your answer, but the proposed solution is too complicated for me :-( A new table is not a solution for me, because my data table is a part of an complex data model and I don't want to reorganize it from scratch. – Duski May 15 '17 at 17:56
  • 1
    Re adding a table for this specific issue, that has zero impact on your existing schema and application. All you would need to do is modify your calendar query to select all the dates in a range and left join your Events table. If you store your data is SQL Server, the other suggestion would work. – Wayne G. Dunn May 15 '17 at 18:27
  • Thank you Wayne. I added a calendar query, which produces all possible calendar dates in field Date, i.e. Date ----------- ... 30.12.2016 31.12.2016 1.1.2017 2.1.2017 3.1.2017 ... How can I join both tables (Event table and Calendar query) to get the result ? Thank you in advance. – Duski May 16 '17 at 07:26
  • I got the solution by adapting the solution provided here [link] (http://stackoverflow.com/questions/27226781/ms-access-get-the-array-of-dates-which-are-located-in-the-range-start-date-to-e). Thank you ! – Duski May 16 '17 at 08:02

0 Answers0