Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ram1986
Starting Member
6 Posts |
Posted - 2014-12-17 : 07:04:05
|
Friends,I have event table with below sample value :table name : EventsEventId EventName EventDateTime StartTime----------------------------------------------1 Event1 2014-12-16 00:00:00.000 4:30 PM2 Event2 2014-12-16 00:00:00.000 8:00 PM4 Event4 2014-12-17 00:00:00.000 10:30 AM3 Event3 2014-12-08 00:00:00.000 11:25 AM1 Event1 2014-12-17 00:00:00.000 8:30 PM2 Event2 2014-12-12 00:00:00.000 6:00 PM3 Event3 2014-12-15 00:00:00.000 10:45 AM5 Event5 2014-12-16 00:00:00.000 2:30 PMI would like to get the next recent Event Based on the current date time, It should be like below formatSuppose today is 2014-12-17 and Current Time is 07:30 AM The expected result should beNextEvent------------Upcomming Event : Event 4 - This Morning 10:45 AM Specifically i am looking for a Format Like BelowIf we have the event by TODAY, The result should be in below format This Morning (12:00 AM to 12:00 PM)This Afternoon (12:00 PM to 4:00 PM) This Evening (4:00 PM to 7:00 PM)Tonight (7:00 PM to 11:59 PM)OR If we have event by TOMORROW, thenTomorrow Morning (12:00 AM to 12:00 PM)Tomorrow Afternoon (12:00 PM to 4:00 PM) Tomorrow Evening (4:00 PM to 7:00 PM)Tomorrow Night (7:00 PM to 11:59 PM)ORJust Display Date and Start Time of Event2014-12-19 by 5:00 PMPlease help me how to get this expected result in SPThanks in Advance |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-12-17 : 08:47:48
|
Please post the query you have so far. If you haven't got one, try to write it and post what you get. |
|
|
|
|
|