Forum Replies Created

Viewing 14 posts - 106 through 119 (of 119 total)

  • RE: Pivot Query Problem

    Yes in 2005 you can, although I had real issues working it out. But only used once... Here is the code I used...

    -- Fixed Column Crosstab with Category Subtotal -...

  • RE: Help With A String Field

    Hi All,

    Okay, I tried the suggested, and after reading books online, looks like I'm close but I h=still can't get it to work. My Code is

    SELECT LEFT(Q5,CHARINDEX('-',Q5)- 1) As...

  • RE: Issues with working query - Help Needed.

    Of course! Guess I need to catch up on my data types! Thxs for your help with this everyone!

  • RE: SQL Mail on SQL2005 not working

    I had a similar problem, after a bit of investigation by be network/windows teams found out that the IP address of your server where SQL is installed may need enabling......

  • RE: Help with query - Quick Response Needed

    Ah the "((ISNULL(DROPPEDCALLS.Dropped, 0))/(Count(History.HistoryID) * 1.0)*100)" worked great! Thank you!!

    SELECTCONVERT(Varchar, History.CallDateTime, 103) As CallDate, (Groups.GroupName) As CampaignName, Count(History.HistoryID) As Calls, ISNULL(DROPPEDCALLS.Dropped, 0) As Drops, ((ISNULL(DROPPEDCALLS.Dropped, 0))/(Count(History.HistoryID) * 1.0)*100) As DropRate

    FROM...

  • RE: Help with query - Quick Response Needed

    Thanks for the quick reply, I have tried the "CONVERT(DECIMAL (3,2)," given but had no luck... Have I misunderstood what you meant?

    Example 1;

    SELECTCONVERT(Varchar, History.CallDateTime, 103) As CallDate, (Groups.GroupName) As CampaignName,...

  • RE: IF Statement for sending email via Database mail

    Okay, modified a bit after looking at examples on the net...

    IF (SELECT ISNULL(Count(Dial.LastCalled),0) As [Counter] FROM cmp_HiddenHearingOverall INNER JOIN Dial ON cmp_HiddenHearingOverall.DialID = Dial.DialID WHERE ((cmp_HiddenHearingOverall.LastCRC = 'AgBAP') OR (cmp_HiddenHearingOverall.LastCRC...

  • RE: SmallDateTime Query

    For example:

    Select EventID, EventDate, Convert(Varchar, EventLocation, 103) As EventDate

    From Table name

    The 103 tells the convert how to present the data, use the link I posted eailer to get different examples...

  • RE: SmallDateTime Query

    Yes, but I would use convert...

    Below is how i used it in a where clause, for reference I have attached the link for Converting Dates. Link> http://msdn.microsoft.com/en-us/library/ms187928.aspx

    (CONVERT(Varchar, dbo.Dial.LastCalled,...

  • RE: *Please Help: Modification To Stored Proceedure to Add date as variable

    I think your right, It won't let you use variables in this way, so I used your suggested work around which works great;

    Use Touchstar

    Go

    exec xp_cmdshell 'COPY C:\SQLData\Templates\Sales.xls C:\SQLData\Exports\Sales.xls'

    Go

    INSERT into OPENROWSET(

    ...

  • RE: *Please Help: Modification To Stored Proceedure to Add date as variable

    Just when I think I have it cracked...:ermm:

    I am now trying to run my second part of my codewhich now pastes the results into the file which has just been...

  • RE: *Please Help: Modification To Stored Proceedure to Add date as variable

    Of course how could I be so dumb! 😀

    Also I found another error, the convert of 103 puts the date as 05/05/2008 which with windows settings caused errors, so I...

  • RE: *Please Help: Modification To Stored Proceedure to Add date as variable

    Well, I'm getting closer,

    DECLARE @CurrentDate as varchar

    SET @CurrentDate = CONVERT(Varchar, GETDATE(), 103)

    Declare @strSQL as Varchar(8000)

    SET @strSQL = 'COPY C:\SQLData\Templates\Sales.xls C:\SQLData\Exports\Sales-' + @CurrentDate + '.xls'

    exec xp_cmdshell @strSQL

    Go

    but what i...

  • RE: *Please Help: Modification To Stored Proceedure to Add date as variable

    Wow that was quick, Okay, makes some sence, I tried the following;

    /*

    DECLARE @CurrentDate as varchar

    SET @CurrentDate = CONVERT(Varchar, GETDATE(), 103))

    Declare @strSQL as String

    SET @strSQL = 'COPY C:\SQLData\Templates\Sales.xls C:\SQLData\Exports\Sales-' +...

Viewing 14 posts - 106 through 119 (of 119 total)