I am a newbie into this and I don't know how to do this.
I have SQUL Server database, where I have records for many dates. It is like this:
id | run | date
1 | 12 | 02.22.2014 14:23:34
2 | 22 | 02.22.2014 18:20:25
3 | 05 | 02.22.2014 20:58:30
4 | 08 | 02.23.2014 08:28:44
5 | 10 | 02.23.2014 12:53:28
6 | 18 | 02.23.2014 14:23:34
What I need is to give a list of all dates, no repeat, and show them in a listbox, using winforms in C#. For instance, in this case I would have just 02.22.2014 and 02.23.2014. In that case, if I select 02.22.2014 I would like to calculate the average 'run' (in this case is 13) and show it in a label.
What is the query I should use and how can I populate the listbox with the dates?
What I've read for mysql there is a query like WHERE DATE('Date')=CURDATE()
.