Click here to Skip to main content
15,896,726 members
Home / Discussions / Database
   

Database

 
GeneralRe: Current Row Index Pin
RChin22-Feb-05 22:48
RChin22-Feb-05 22:48 
GeneralMSDE2000A Pin
caoquanghanh22-Feb-05 0:05
caoquanghanh22-Feb-05 0:05 
Generalabout autherization Pin
Allah Kaa Bandaa21-Feb-05 22:10
Allah Kaa Bandaa21-Feb-05 22:10 
Generalstrange problem using ado to add record Pin
Dababa21-Feb-05 15:57
Dababa21-Feb-05 15:57 
GeneralStrange problem using OLE DB Consumer Templates Pin
lisoft21-Feb-05 13:56
lisoft21-Feb-05 13:56 
GeneralExcel Oledb Pin
Devius21-Feb-05 13:38
Devius21-Feb-05 13:38 
GeneralPlease HELP! Data Source Configuration Wizard Pin
Member 169642421-Feb-05 7:13
Member 169642421-Feb-05 7:13 
GeneralEXCLUDING DATA USING DATE AS PARAMETER Pin
Brendan Vogt20-Feb-05 19:28
Brendan Vogt20-Feb-05 19:28 
Hi,

I have an archives sectionon my website. It must display all news except the news of the current. So if we work on the current year and month, then all news articles mut display except news articles that were added for February 2005. My logic says that they SQL statement must look somthing like:

SELECT NewsID_PK, NewsSubject, NewsDateAdded
FROM tblNews
WHERE (YEAR(NewsDateAdded) <> 2005 AND MONTH(NewsDateAdded) <> 2)
ORDER BY NewsDateAdded DESC;

But this doesn't display correctly. If I replace the AND with anOR thenit works,like this:

SELECT NewsID_PK, NewsSubject, NewsDateAdded
FROM tblNews
WHERE (YEAR(NewsDateAdded) <> 2005 OR MONTH(NewsDateAdded) <> 2)
ORDER BY NewsDateAdded DESC;

I don't understand why. Can some one please explain why. If there is a better way of writing this statement, please let me know.

Any help and suggestions would be appreciated!!

Thanks
Brendan
GeneralRe: EXCLUDING DATA USING DATE AS PARAMETER Pin
Colin Angus Mackay20-Feb-05 19:54
Colin Angus Mackay20-Feb-05 19:54 
GeneralRe: EXCLUDING DATA USING DATE AS PARAMETER Pin
Member 174480620-Feb-05 21:17
Member 174480620-Feb-05 21:17 
GeneralSQL Server Replace Text/Characters Pin
Brendan Vogt20-Feb-05 19:27
Brendan Vogt20-Feb-05 19:27 
GeneralRe: SQL Server Replace Text/Characters Pin
Colin Angus Mackay20-Feb-05 19:58
Colin Angus Mackay20-Feb-05 19:58 
GeneralCreating New Table and Pump data from ActiveX Pin
Mehbub19-Feb-05 3:27
Mehbub19-Feb-05 3:27 
GeneralRowNumber in results. Pin
ABBASI_RA18-Feb-05 23:52
ABBASI_RA18-Feb-05 23:52 
GeneralRe: RowNumber in results. Pin
Mike Ellison19-Feb-05 19:53
Mike Ellison19-Feb-05 19:53 
GeneralRe: RowNumber in results. Pin
ABBASI_RA20-Feb-05 1:37
ABBASI_RA20-Feb-05 1:37 
GeneralRe: RowNumber in results. Pin
Mike Ellison22-Feb-05 9:48
Mike Ellison22-Feb-05 9:48 
GeneralRe: RowNumber in results. Pin
SimonS20-Feb-05 1:47
SimonS20-Feb-05 1:47 
GeneralRe: RowNumber in results. Pin
ABBASI_RA20-Feb-05 2:40
ABBASI_RA20-Feb-05 2:40 
GeneralBack up database Pin
GoldenStar18-Feb-05 22:56
GoldenStar18-Feb-05 22:56 
GeneralRe: Back up database Pin
Colin Angus Mackay19-Feb-05 1:10
Colin Angus Mackay19-Feb-05 1:10 
GeneralRe: Back up database Pin
GoldenStar20-Feb-05 10:13
GoldenStar20-Feb-05 10:13 
GeneralSome help with this SQL statement Pin
Tom Wright18-Feb-05 7:05
Tom Wright18-Feb-05 7:05 
GeneralRe: Some help with this SQL statement Pin
Michael Potter18-Feb-05 9:02
Michael Potter18-Feb-05 9:02 
GeneralRe: Some help with this SQL statement Pin
Tom Wright18-Feb-05 12:48
Tom Wright18-Feb-05 12:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.