Forum Replies Created

Viewing 15 posts - 346 through 360 (of 366 total)

  • RE: DateTime format to mmmdd format

    This is adding a leading 0 when one is not needed

    declare @thedate datetime

    set @thedate = '4/25/05'

    Select replace(Replace(Convert(Char(6),@thedate,109),' ','0'),' ','')

    Returns

    Apr025 which has a leading 0 when it is not needed

    Thanks

    Mike

  • RE: DateTime format to mmmdd format

    From previous post consider the following SQL statements and return values

    Select Replace(Convert(Char(6),GetDate(),100),' ','') as 'Date1'

    --Returns

    --Apr25

    Select Replace(Convert(Char(6),'4/25/05',100),' ','')as 'Date2'

    --Returns

    --4/25/0

    Select Replace(Convert(Char(6),'04/25/05',100),' ','')as 'Date3'

    --Returns

    --04/25/

    -- The next one works with GetDate(),

    -- ignores leading trailing...

  • RE: Converting Row to Column?

    Hi Jan, I am not quite sure what you are looking for. Are you selecting data from more than one table and if so what is the relationship between tables....

  • RE: DTS - Execute SQL Task - Using Parameters

    Hi you might find the article

    Global Variables and SQL statements in DTS

     

     

    Of interest

    http://www.sqldts.com/default.aspx?205,2

     

    Also try

    http://www.databasejournal.com/features/mssql/article.php/1462181

  • RE: Challenge for SQL Gurus: Grouping and outer joins

    Remi thanks. Just fuzzy thinking here in re-reading the original post I see that cartesian result is required. I must have a thing about requesting data that is not needed or creating...

  • RE: Challenge for SQL Gurus: Grouping and outer joins

    Noeld, Remi thanks for your response. Now just one more question (I caught this just one more question habit from my kids.

  • RE: Error 557

    I agree with Phill. Perhaps you are approaching the problem in the wrong manner. IMHO I would suggest:

     1. Define the desired output

    2. Determine the needed inputs

    3. Forget the Orcal code

    4....

  • RE: Challenge for SQL Gurus: Grouping and outer joins

    Hi guys a quick question on the posts by Carl and Hariharan. First Carl's post uses a cross join without a where statement which will produce a Cartesian product of...

  • RE: Concatenation

    Frank the link you posted is broken, or at least on my machine it is broken.

    Ed your quote is adapted from the Peter...

  • RE: On Cursors

    Trying to debug a script without knowing the business logic will turn your hair grey In my experience a quick, simple conversion of...

  • RE: List of databases on MSDE instance

     

    Phil, wierd is not the word I would have choosen as it is not descriptive enough.

    Two quick questions. first have you run a...

  • RE: Need to change the behavior of COUNT/GROUP BY

    I think the following select statement will give you what you want. There is a problem in that “count” does not include NULL values thus from the result...

  • RE: List of databases on MSDE instance

    Phil, I have been unable to replicate the behaviors you are describing.  
     My understanding from BOL is that Sp_databases reads the system...
  • RE: List of databases on MSDE instance

    Phil, have you tried the following from BOL.

    sp_databases (T-SQL)

    Lists databases that reside in the Microsoft® SQL Server™ installation or are accessible through a database gateway.

    Syntax

    sp_databases

    Return Code Values

    None

    Result...
  • RE: List of databases on MSDE instance

    Diederik, the problem with undoumented procedures is that they are undocumented and there is no Guarantee that the next sp or upgrade will not break the procedure. Been there done...

Viewing 15 posts - 346 through 360 (of 366 total)