Viewing 11 posts - 1 through 12 (of 12 total)
quote:
How would I get the earliest date for each Case_Number with the following query?SELECT Case_Table.Case_Number, Note_Table.Date_Entered
FROM Case_Table
INNER JOIN Note_Table ON Case_Table.Case_Number =...
December 8, 2002 at 1:48 pm
My favorite response for these "how do I" questions is always the same: Look for a system stored procedure that does it, then go take it apart. 99.9% of...
December 8, 2002 at 1:41 pm
You can create a user-defined function that does the compare and returns 1 or 0 depending on found/not found.
Then use the UDF in your WHERE clause
select *
from table
where dbo.UDFComparelist(ColumnToCompare) =...
December 8, 2002 at 1:39 pm
how about this
declare @one int, @two int
if @test-2=1
begin
@one=1
@two=2
end
etc.
select ...
where Col in (@one, @Two)
December 8, 2002 at 1:35 pm
This is an example of where a self join can help.
select * from table1 outside
where crdate =
(select min(crdate)
from table1 inside
where datepart(yyyy, outside.crdate) = datepart(yyyy, inside.crdate)
and datepart(MM, outside.crdate) =...
December 8, 2002 at 1:34 pm
This is an example of where a self join can help.
select * from table1 outside
where crdate =
(select min(crdate)
from table1 inside
where datepart(yyyy, outside.crdate) = datepart(yyyy, inside.crdate)
and datepart(MM, outside.crdate) =...
December 8, 2002 at 1:34 pm
This is an example of where a self join can help.
select * from table1 outside
where crdate =
(select min(crdate)
from table1 inside
where datepart(yyyy, outside.crdate) = datepart(yyyy, inside.crdate)
and datepart(MM, outside.crdate) =...
December 8, 2002 at 1:33 pm
This is an example of where a self join can help.
select * from table1 outside
where crdate =
(select min(crdate)
from table1 inside
where datepart(yyyy, outside.crdate) = datepart(yyyy, inside.crdate)
and datepart(MM, outside.crdate) =...
December 8, 2002 at 1:30 pm
I can see MSDE but not .NET. The focus of this site is SQL Server, not other programming environments. MSDE is a viable platform, it not technically a...
December 8, 2002 at 1:20 pm
quote:
How about some method of indicating that the discussion is complete, or that the questioner has the answer they wanted?Thanks
Phill Carter
December 8, 2002 at 1:18 pm
A timestamp field is updated on every insert and update. You can't control its value but it would be incremented automatically and would be unique in the data base....
December 8, 2002 at 1:16 pm
Viewing 11 posts - 1 through 12 (of 12 total)