vendredi 31 juillet 2015

Entity-framework SQL query on DateTime

I want to get 5 popular stories using Entity-framework query in a time span for example in 7 days and 14 days. I am storing views in a separate table with DateTime parameters with StoryID.

Stories Table

StoryID--------Story
1-----------story one
2-----------story two 
3-----------story three
4-----------story four
5-----------story five
6-----------story six

Views Table

ViewID---------ViewDate---------StoryID
1------2015-07-17 19:00:00--------1
2------2015-07-17 20:00:00--------1
3------2015-07-17 21:00:00--------2
4------2015-07-18 19:00:00--------2
5------2015-07-19 19:00:00--------2
6------2015-07-21 19:00:00--------1
7------2015-07-23 19:00:00--------2

Can you guys please help me figuring this out. Thanks

Aucun commentaire:

Enregistrer un commentaire