Click here to Skip to main content
15,895,606 members
Home / Discussions / Database
   

Database

 
GeneralRe: DataGrid Columns Pin
Just Greeky Creek16-Feb-05 21:15
Just Greeky Creek16-Feb-05 21:15 
GeneralRe: DataGrid Columns Pin
numbrel17-Feb-05 3:06
numbrel17-Feb-05 3:06 
GeneralSQL Guru challenge :) Or just a simple query question Pin
Richard Parsons16-Feb-05 3:07
Richard Parsons16-Feb-05 3:07 
GeneralRe: SQL Guru challenge :) Or just a simple query question Pin
Michael Potter16-Feb-05 3:24
Michael Potter16-Feb-05 3:24 
GeneralRe: SQL Guru challenge :) Or just a simple query question Pin
Richard Parsons16-Feb-05 6:50
Richard Parsons16-Feb-05 6:50 
GeneralTest data script Pin
Richard Parsons16-Feb-05 6:51
Richard Parsons16-Feb-05 6:51 
GeneralEDIT: SQL Guru challenge :) Or just a simple query question Pin
Richard Parsons16-Feb-05 7:27
Richard Parsons16-Feb-05 7:27 
GeneralRe: EDIT: SQL Guru challenge :) Or just a simple query question Pin
Michael Potter16-Feb-05 8:49
Michael Potter16-Feb-05 8:49 
I think you are mis-stating your criteria. 'c' is the 2nd to a last record using RefId 500. It is not the 2nd to last in RefId 100, 300, 400. Your code dumps all RefIds. Here is some code that reports if 'c' is the 2nd to last record (by the DateTime order that you didn't specify in the first message).

SELECT *
FROM Table1 
WHERE  
    (SELECT COUNT(*)
     FROM Table2
     WHERE RefId = Table1.refId AND
           dt > (SELECT dt
                 FROM Table2
                 WHERE RefId = Table1.refId AND
                       Code = 'c')) = 1


If you are truely looking for the 3rd to last then just change the '1' to '2'. If you want to make sure that 'c' can not be the first than add that criteria also.
GeneralRe: EDIT: SQL Guru challenge :) Or just a simple query question Pin
Richard Parsons16-Feb-05 11:34
Richard Parsons16-Feb-05 11:34 
GeneralRe: SQL Guru challenge :) Or just a simple query question Pin
NassosReyzidis10-Mar-05 1:11
NassosReyzidis10-Mar-05 1:11 
Generalprob in sp Pin
amalatsliit15-Feb-05 16:46
amalatsliit15-Feb-05 16:46 
GeneralRe: prob in sp Pin
Rob Graham16-Feb-05 15:59
Rob Graham16-Feb-05 15:59 
GeneralRe: prob in sp Pin
amalatsliit16-Feb-05 19:33
amalatsliit16-Feb-05 19:33 
GeneralRe: prob in sp Pin
Mike Dimmick17-Feb-05 1:31
Mike Dimmick17-Feb-05 1:31 
GeneralRe: prob in sp Pin
amalatsliit17-Feb-05 16:01
amalatsliit17-Feb-05 16:01 
GeneralCasting error when passing a strongly typed dataset from a Webservice Pin
dazzler215-Feb-05 16:41
dazzler215-Feb-05 16:41 
GeneralRe: Casting error when passing a strongly typed dataset from a Webservice Pin
dazzler215-Feb-05 20:47
dazzler215-Feb-05 20:47 
Generalprob with sp return value Pin
amalatsliit15-Feb-05 15:55
amalatsliit15-Feb-05 15:55 
GeneralRe: prob with sp return value Pin
Scott Serl16-Feb-05 8:52
Scott Serl16-Feb-05 8:52 
GeneralRe: prob with sp return value Pin
amalatsliit16-Feb-05 15:17
amalatsliit16-Feb-05 15:17 
GeneralRe: prob with sp return value Pin
Scott Serl16-Feb-05 16:25
Scott Serl16-Feb-05 16:25 
GeneralRe: prob with sp return value Pin
amalatsliit16-Feb-05 19:25
amalatsliit16-Feb-05 19:25 
QuestionCould someone answer this? Pin
Tom Wright15-Feb-05 10:51
Tom Wright15-Feb-05 10:51 
AnswerRe: Could someone answer this? Pin
Rob Graham16-Feb-05 16:11
Rob Graham16-Feb-05 16:11 
GeneralRe: Could someone answer this? Pin
Tom Wright17-Feb-05 4:27
Tom Wright17-Feb-05 4:27 

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.