Forum Replies Created

Viewing 15 posts - 916 through 930 (of 2,452 total)

  • RE: Datetime conversion

    Luis Cazares (1/29/2016)


    Maybe this:

    DECLARE @date varchar(10) = '14-Apr'

    SELECT CONVERT(datetime, '01 ' + RIGHT(@date,3) + ' ' + LEFT(@date,2), 6)

    Hi Luis......why not just use this instead??

    SELECT CONVERT(datetime, '20'+@date)

    ??

    also,I believe that...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Formatting SQL

    http://www.ssmstoolspack.com/

    not free for 2012 and above, but does include a lot of functionality beyond refactoring.......not overly expensive and has a free 60 day / 1pc trial

    maybe worth a look

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Datetime conversion

    not sure but maybe?

    SELECT TRY_CONVERT(datetime, '20'+'14-Apr') AS Result;

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Create username uniquely

    TEJABI (1/29/2016)


    create table UserName (FirstName varchar(50),LastName varchar(50))

    insert into Username select 'Abhas' ,'Jadhav'

    Union

    select 'Ashwin' ,'Jadhav'

    UNION

    select 'Akash','Jadhav'

    UNION

    select 'Bbhas' ,'Jadhav'

    Union

    select 'Bshwin' ,'Jadhav'

    UNION

    select 'Bkash','Jadhav'

    with cte as

    (

    select newid () sysid ,(SUBSTRING(FirstName,1,1)) firstname...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Formatting SQL

    Jeff Moden (1/29/2016)


    Heh... just select the "obfuscation" method and you're done. 😛

    hehe....had never used it, til now.........cant see the point

    original

    CREATE TABLE mytable(

    TranID ...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: SQL Query - 2 tables required result field is different to linking field

    Shabbaranks (1/29/2016)


    That link will certainly help me in the future thank you. I think I've solved the issue now (well Im currently testing the output) the solution was I wasn't...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Formatting SQL

    http://www.apexsql.com/sql_tools_refactor.aspx

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Please need help to get result from below query

    patla4u (1/29/2016)


    Thank you.

    you are welcome, but please next time, heed the advice in this post http://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Please need help to get result from below query

    maybe ?

    SELECT t_item,

    t_cwar,

    MIN(t_trdt),

    MAX(t_trdt),

    ...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: SQL Query - 2 tables required result field is different to linking field

    Shabbaranks (1/29/2016)


    Sorry (and looking at your signature Im guilty... the you can lead a user to data)

    Anyway so Im looking to get from the 2 tables see attachment as the...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: SQL Query - 2 tables required result field is different to linking field

    Shabbaranks (1/29/2016)


    Hi Hugo,

    Again thanks for taking the time to assist its really appreciated. I didn't really want to mess with the SQL server and the DB where the data is...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate Session Time

    have a read here

    http://www.sqlservercentral.com/articles/T-SQL/103343

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Importing Error - Text was truncated...

    VegasL (1/23/2016)


    Ok I found the solution - I think. I had to filter out the data in the column in .xls that was over 255 characters. Then modified data...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: How to figure out whether data is selected from dirty pages?

    According to them, report's details should be known exactly. But I explained to them that while ETL process is loading, we have to wait (because we are blocked) or accept...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: rolling 12 months

    Hi

    read the following on how to give us relevant details to respond with an answer that meets your expectations

    thanks

    http://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 15 posts - 916 through 930 (of 2,452 total)