Forum Replies Created

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

  • RE: How to return week number in 2 digit form

    If you want it that way, then you will have to loose the INT data-type and your string will be of VARCHAR..

  • RE: Need help with Transpose

    Exactly.. use PIVOT with some aggregate functions, then u can transpose rows to columns! There is also another old method, which is bit faster than PIVOT for larger data sets!...

  • RE: Conbersion error - urgent!

    malavika.ramanathan (5/12/2010)


    hi,

    thanks for your reply. i dont think it works practically as there are many possible durations...or even if we think of 5 min duration the least, i will have...

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

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