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
 General SQL Server Forums
 New to SQL Server Programming
 Displaying data

Author  Topic 

Ste_512
Starting Member

2 Posts

Posted - 2011-04-19 : 02:42:46
Hi all,

I'm new to all this and have come across what is proberbly a small issue. What I have is a data base with 4 col, date, comp, hometeam and away team. I am using dreamweaver and I need an SQL statement that will allow me to view selected information from my database, for example I have a team called stanleys starlets starlets in the data base and I would like to be able to see all the games he plays in may, so it just sorts the date, and all games played in may.

Hope this helps

Thanks Ste

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-04-19 : 07:20:50
select *
from games
where (hometeam = 'stanleys starlets starlets'
or awayteam = 'stanleys starlets starlets')
and date between '20110501' and '20110531'
order by date

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Ste_512
Starting Member

2 Posts

Posted - 2011-04-20 : 12:12:57
Thanks Nigel, works a treat

Ste
Go to Top of Page
   

- Advertisement -