G Y

G Y

  • 1.5k
  • 229
  • 44.2k

SQL Query or Linq query to get number of Events per Day.

Nov 30 2017 2:24 AM
SQL query or linq query to get the number of events per day for each and every record (Id), Event Jupiter, Earth and Mars comes under 7th Date so number of events is 3(considering time).
1. A event can start and end in the same day.
2. A event can start today and end after 3 days.
 
Table Name: **Events**
 
 Id Name StartDateWithTime EndDateWithTime
 1 Sun 2017-11-28 00:00:00.000 2017-11-29 0:00:00.000
 2 Moon 2017-11-28 00:00:00.000 2017-12-01 10:00:00.000
 3 Earth 2017-11-07 00:00:00.000 2017-11-30 00:40:00.000
 4 Jupiter 2017-11-07 00:00:00.000 2017-11-07 20:00:00.000
 5 Mars 2017-11-07 10:00:00.000 2017-12-07
 
SQL query or linq query to get the number of events per day

Answers (2)