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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 same date issue

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 date
FROM visits
where date = date

that doesnt work, neither does

SELECT distinct date
FROM visits

this 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?
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2003-12-10 : 09:06:29
select date, count(*)
from visits
group by date
having count(*) > 1

will 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.
Go to Top of Page

nricardo
Starting Member

17 Posts

Posted - 2003-12-10 : 13:25:34
SELECT date
FROM visits
where convert(char(10), date1, 101) = convert(char(10), date2, 101)
Go to Top of Page
   

- Advertisement -