Forum Replies Created

Viewing 15 posts - 1,561 through 1,575 (of 1,920 total)

  • RE: Conbersion error - urgent!

    Malaivaka, tel us if the following code helps you

    SELECT CASE DURATION

    WHEN '60' THEN '01:00'

    ...

  • RE: Grouping - SQL

    Ankur, there are many methods of grouping data , based on the way we want our output to be!

    I recommend you go through the following article:

    CLICK HERE FOR FORUM POSTING...

  • RE: get rows from joins which doesn't match

    Hey there, you can use on of the following

    SELECT

    EP.EMPLOYEE_ID,

    EP.FIRST_NAME + ' ' + ISNULL(EP.MIDDLE_NAME, ' ') + ' ' + ISNULL(EP.LAST_NAME, ' ') AS FULL_NAME,

    MB.BUSINESSUNIT_NAME,

    CONVERT(VARCHAR(10), EP.DATE_OF_BIRTH, 101) AS DATE_OF_BIRTH,...

  • RE: identity column

    For another server, you can use

    SELECT * FROM <Your_Server_Name>.<Your_Database_Name>.sys.identity_columns

    provided you have the 2 servers linked using Linker Servers!

    Or you can use OPENROWSET or OPENDATASOURCE to access data on another...

  • RE: Monthly Data

    Hi friend!

    Here is a code that might do what you wished!

    ;WITH DATE_CTE AS

    (

    SELECT DISTINCT DATEPART(MM,from_date) [MONTH] FROM #sample_data

    )

    SELECT SD.facility , DC.[MONTH], COUNT(*) ...

  • RE: identity column

    Glad i could help! You're welcome! 🙂

  • RE: identity column

    If you wish to see the column names, then use the sys.identity_columns catalog view

    Sample SQL code for this:

    SELECT * FROM sys.identity_columns

    To read more about this, click here :- sys.identity_columns!

    Hope this...

  • RE: identity column

    You can use IDENT_INCR and IDENT_SEED functions to get the seed and increment of a table/view.

    For more on them, click on them!

    Hope this helps you!

    Cheers!

  • RE: Monthly Data

    I dint understand your Expected result.. can u pls elaborate??

    I see that

    1. For the first month, you are finding the count of distinct facility - which gives '01'...

  • RE: Comparing two rows in one table for changes in column

    Now that you have posted the sample data and table structure, half the job is prettily done 🙂 Now can you give us some visual representation of how your expected...

  • RE: calculate dates between rows

    hmmm.. yes.. lets wait for FilMar to march on! 😀

  • RE: calculate dates between rows

    Gianluca Sartori (5/11/2010)


    ColdCoffee (5/11/2010)


    Wow, Gianluca.. cool code.. 😎

    Thanks, but we still don't know if this is what the OP is after.

    Could turn out to be cool... garbage! 😛

    :-P. Gian, i...

  • RE: calculate dates between rows

    Wow, Gianluca.. cool code.. 😎

  • RE: Non-aggregate column included in aggregate query

    Again, without seeing your BREED table and K9 table how are we to assume what data is in, where you are going wrong and what we can do for you.

    Please...

  • RE: Comparing two rows in one table for changes in column

    I din't understand your requirement clearly; But stil, as far as i understood, here is a piece of cdoe that might interest you.

    Look at how i am posting the data...

Viewing 15 posts - 1,561 through 1,575 (of 1,920 total)