Forum Replies Created

Viewing 11 posts - 1 through 12 (of 12 total)

  • RE: Pulling record with the earliest date

    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 =...

  • RE: Identity Column In Table

    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...

  • RE: - Syntax Question

    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) =...

  • RE: Select ...Where in Case....End syntax question

    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)

  • RE: Getting One Record Per Month

    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) =...

  • RE: Getting One Record Per Month

    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) =...

  • RE: Getting One Record Per Month

    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) =...

  • RE: Getting One Record Per Month

    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) =...

  • RE: asp.net

    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...

  • RE: Discussion Completed??

    quote:


    How about some method of indicating that the discussion is complete, or that the questioner has the answer they wanted?

    Thanks

    Phill Carter


  • RE: Select Progressive Number, Re-visited

    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....

Viewing 11 posts - 1 through 12 (of 12 total)