Forum Replies Created

Viewing 15 posts - 31 through 45 (of 45 total)

  • RE: COUNT problem

    how would I use this if I wanted to use the following:

    declare @count int

    set @count = ?

    if @count>=1

    Jack Corbett (7/29/2008)


    You can immediately follow your first query with Select @@ROWCOUNT which...

  • RE: COUNT problem

    great, that's really useful to know.

    Thanks.

    Jack Corbett (7/29/2008)


    You can immediately follow your first query with Select @@ROWCOUNT which returns the # of rows returned by the previous statement.

  • RE: removing column underlining in database mail attachments

    Interesting... do you have any good tutorials that have helped you with this?

    GSquared (7/25/2008)


    I don't think there's a way to customize that.

    Personally, I've found attaching the query results pretty useless....

  • RE: need help with changing the case of text

    very true 🙂

    Jason Selburg (6/16/2008)


    No questions are stupid, they're just sometimes "untimely" as in the answer comes to you right after you ask it.

  • RE: need help with changing the case of text

    that was a stupid question. Thanks for your help.

    Jason Selburg (6/16/2008)


    adam (6/16/2008)


    Thanks. I would like to actually convert these permanently to upper case.

    Carolyn Richardson (6/16/2008)


    Try SELECT UPPER('John Doe')

    UPDATE...

  • RE: need help with changing the case of text

    Thanks. I would like to actually convert these permanently to upper case.

    Carolyn Richardson (6/16/2008)


    Try SELECT UPPER('John Doe')

  • RE: tracking the success of jobs

    thanks

    ahutch (6/4/2008)


    I'm no TSQL expert, so someone could probably right a much better script than I could, but you want to look into joining these two tables:

    [msdb].[dbo].[sysjobhistory]

    [msdb].[dbo].[sysjobs]

  • RE: Can DatabaseMail attach a formatted Excel file?

    great! the tab between the ' ' works perfectly.

    I had long since given up on this thread. Thanks for the solution.

    Adam.

    Ted Walsh (5/27/2008)


    I have had similar problems with...

  • RE: formatting the zipcode

    Ah, I forgot about LEN.

    Thanks for all your help.

  • RE: formatting the zipcode

    Thank you.

    I don't know too much about variables.

    set @zip = (select zipcode from DEMOG) does not work because there is more than one result.

    How would I go about updating all...

  • RE: Can DatabaseMail attach a formatted Excel file?

    Jason Shadonix (2/29/2008)


    Have you tried playing with the @query_result_separator? Perhaps make it a space or comma instead of an empty string?

    I have, and the data rows are still squashed...

  • RE: Can DatabaseMail attach a formatted Excel file?

    Jack Corbett (2/29/2008)


    Because you are naming the file with an "XLS" extension, Excel thinks it is a native file and is not looking for a delimiter.

    I would use...

  • RE: count problem

    Matt Miller (2/26/2008)


    Sure - using the "old-style" pivotting syntax:

    Select user, datepart(yyyy,datein) as Yr,

    sum(case when datepart(mm,datein) =1 then 1 else 0 end)...

  • RE: count problem

    Matt Miller (2/25/2008)


    Select user,

    datepart(yyyy,datein)*100+datepart(mm,datein) as yearmonth,

    count(datein) as LoginCount

    from login

    WHERE

    ...

  • RE: count problem

    Matt Miller (2/25/2008)


    Are you trying to get a count by month by user? or do you just want a count by user for the period?

    Yes, count by month by...

Viewing 15 posts - 31 through 45 (of 45 total)