Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Compare records in same table Expand / Collapse
Author
Message
Posted Friday, September 18, 2009 1:27 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, December 4, 2014 2:11 AM
Points: 44, Visits: 135
I have one table test where million of records.
The table is not having any primary column.
The columns in table are positionid,ID1,ID2,Event,DrC,Acct,Amount,
valuedate, and Ccyt.
There are lot of records for valuedate= 20070731 and 20070724. There are other valuedate also.
But i want to fetch all the different records except valuedate for these two value date (20070731 and 20070724) in table.

Please provide me query. I am using sql server 2005.
Post #790141
Posted Friday, September 18, 2009 6:14 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, November 13, 2012 5:18 AM
Points: 37, Visits: 166
isnt it " Where valuedate <>'20070731' and Valudate <>'20070724' ?

or i didnt get the question correct

Post #790313
Posted Friday, September 18, 2009 6:18 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 11:49 AM
Points: 14,468, Visits: 38,070
i'd do it almost the same as the thetodaisies,just changed it to be ready for more dates to exclude:

valuedate NOT IN('20070731','20070724' )


Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Post #790315
Posted Friday, September 18, 2009 6:21 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, September 23, 2016 4:01 AM
Points: 1,896, Visits: 3,068
Lowell (9/18/2009)
i'd do it almost the same as the thetodaisies,just changed it to be ready for more dates to exclude:

valuedate NOT IN('20070731','20070724' )


Question is a bit fague, but I must agree with Lowell here.


----------------------------------------------
Msg 8134, Level 16, State 1, Line 1
Divide by zero error encountered.
Post #790317
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse