Forum Replies Created

Viewing 15 posts - 631 through 645 (of 3,543 total)

  • RE: Function to Convert Current Date to SQL Sever Date format.

    I do not oracle but after a quick google search, try this

    SELECT *

    FROM OPENQUERY (LS_RDB_DWH, 'SELECT * FROM RDB_DWH.ENTITY_DIMENSION WHERE PD_RDB_ENTRY_DATE >= TRUNC(SYSDATE)')

  • RE: Function to Convert Current Date to SQL Sever Date format.

    The syntax error is due to insufficient quotes. You have use two single quotes to get one when using them inside OPENQUERY

    ie

    SELECT *

    FROM OPENQUERY (LS_RDB_DWH, 'SELECT * FROM RDB_DWH.ENTITY_DIMENSION WHERE...

  • RE: Function to Convert Current Date to SQL Sever Date format.

    Your query is returning a date datatype, the gui interface (SSMS) is displaying as characters formatted as to the language of the login.

    So

    SELECT CONVERT(DATE,GETDATE()) AS CurrentDate;

    and

    SELECT CONVERT(varchar(10),GETDATE(),120) AS...

  • RE: Function to Convert Current Date to SQL Sever Date format.

    SYSDATETIME() will give you current date and time

    CAST(SYSDATETIME() as date) will give you current date only

    What are you referring to with 'Current Date'?

    What do you mean by SQL Server Date...

  • RE: Need Help - SQL Select Statement

    Eirikur Eiriksson (8/27/2014)


    ... Guess I've been tainted by the Brits and they'r ironic sarcastic humour ...

    In that case

    SELECT a.steps,MIN(b.steps)

    FROM #table1 a

    CROSS JOIN #table1 b

    WHERE b.steps >...

  • RE: Display ALL rows even if no data exists

    pwalter83 (8/26/2014)


    Actually this worked superbly well for the OP ! I had been stuck on this for a long time now and had given up all hope

    You're welcome 🙂

    As an...

  • RE: Display ALL rows even if no data exists

    SELECTa.BOOKING_NUM,

    d.COUNTRY_DSC,

    CASE WHEN POL_LOCATION_CD IN ('DKAAR', 'DKCPH', 'FIHEL','FIKTK', 'IEORK', 'IEDUB', 'NLRTM', 'PTLEI', 'PTOPO', 'PTLIS', 'ESBIO', 'ESVGO', 'SEGOT', 'SEHEL', 'GBBEL') THEN 'NLRTM' WHEN POL_LOCATION_CD IN ('DKFRC',

    'FIRAU', 'FIOUL', 'DEBRV', 'NOAES', 'NOBGO',...

  • RE: Compare two columns

    CASE WHEN PATINDEX(REPLACE(LEFT(address,CHARINDEX('.',address)-1),'@','@exc.')+'%,',alias+',') > 0

    THEN STUFF(alias,PATINDEX(REPLACE(LEFT(address,CHARINDEX('.',address)-1),'@','@exc.')+'%,',alias+','),

    (CHARINDEX(',',alias+',',PATINDEX(REPLACE(LEFT(address,CHARINDEX('.',address)-1),'@','@exc.')+'%,',alias+','))

    - PATINDEX(REPLACE(LEFT(address,CHARINDEX('.',address)-1),'@','@exc.')+'%,',alias+','))+1,'')

    ELSE alias

    END

  • RE: Are the posted questions getting worse?

    Koen Verbeeck (8/19/2014)


    higgim (8/18/2014)


    Not a happy chap with some of the help being offered! Go figure 🙂

    Qira (8/18/2014)


    Dear Mr Higgam,

    You're helping me sir. Thanks to you. But no thanks to...

  • RE: Split string to show only customer

    If you want another alternative

    LTRIM(PARSENAME(REPLACE(SomeString,'-','.'),1))

    😀

    *Edited*

    p.s. BTW, before you start, I did not say it was a good alternative 😛

  • RE: Today's Random Word!

    SQLRNNR (8/14/2014)


    Ed Wagner (8/14/2014)


    Sean Lange (8/14/2014)


    peanut butter

    Nutella

    creamy jar of deliciousness

    :sick:

  • RE: Today's Random Word!

    This thread is becoming less Random and more Jung 😛

  • RE: Are the posted questions getting worse?

    Jeff Moden (8/4/2014)


    Koen Verbeeck (8/4/2014)


    Lynn Pettis (8/4/2014)


    Whom ever has the Great Mystical Crystal Ball, you are needed here.

    I am afraid I have left it in my other coat...

    I'd let you...

  • RE: Are the posted questions getting worse?

    Sean Lange (7/28/2014)


    More like sinking.

    Not waving, but drowning 😛

    The thread is sure to test your sanity (unless you are already insane :w00t:)

  • RE: How to efficiently import data in .rpt format into SQL 2008

    Jeff Moden (7/23/2014)


    BCP will actually handle such trailing garbage lines quite well, BCP FORMAT File or not.

    Yes you are right Jeff 😀

    I tried several tests with the data supplied and...

Viewing 15 posts - 631 through 645 (of 3,543 total)