Help to the way to write a query for the requirement
- by Lu Lu
I need to write a SQL-Server query but I don't know how to solve. I have a table RealtimeData with data:
Time | Value
4/29/2009 12:00:00 AM | 3672.0000
4/29/2009 12:01:00 AM | 3645.0000
4/29/2009 12:02:00 AM | 3677.0000
4/29/2009 12:03:00 AM | 3634.0000
4/29/2009 12:04:00 AM | 3676.0000
4/30/2009 12:00:00 AM | 3671.0000
4/30/2009 12:01:00 AM | 3643.0000
4/30/2009 12:02:00 AM | 3672.0000
4/30/2009 12:03:00 AM | 3634.0000
4/30/2009 12:04:00 AM | 3632.0000
4/30/2009 12:05:00 AM | 3672.0000
5/1/2009 12:00:00 AM | 3673.0000
5/1/2009 12:01:00 AM | 3642.0000
5/1/2009 12:02:00 AM | 3672.0000
5/1/2009 12:03:00 AM | 3634.0000
5/1/2009 12:04:00 AM | 3635.0000
I want to get the EOD's data of days which exist in table. (EOD = end of day). With the my sample's data, I will need to reture a table like following:
Time | Value
4/29/2009 | 3676.0000
4/30/2009 | 3672.0000
5/1/2009 | 3635.0000
Please help me to solve my problem. Thanks.