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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-12-10 : 08:30:45
|
| hakeem writes "I know this isnt hard. I think my brain has just frozen up because this sounds soo simple. I need to run a query giving me only dates which are equal. ive tried:SELECT dateFROM visitswhere date = datethat doesnt work, neither doesSELECT distinct dateFROM visitsthis is simple as getting a list of people with the same birthdays. I just cant figure it out.(its the end of the school semester, my brian is dead)." |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2003-12-10 : 08:41:31
|
| Can't help unless you rephrase your question."I need to run a query giving me only dates which are equal to what? |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-12-10 : 09:06:29
|
| select date, count(*)from visitsgroup by datehaving count(*) > 1will give dates with more than one entry.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
nricardo
Starting Member
17 Posts |
Posted - 2003-12-10 : 13:25:34
|
| SELECT dateFROM visitswhere convert(char(10), date1, 101) = convert(char(10), date2, 101) |
 |
|
|
|
|
|