Viewing 14 posts - 106 through 119 (of 119 total)
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 -...
May 12, 2008 at 1:35 pm
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...
May 12, 2008 at 1:31 pm
Of course! Guess I need to catch up on my data types! Thxs for your help with this everyone!
May 11, 2008 at 2:28 pm
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......
May 9, 2008 at 3:58 am
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...
May 7, 2008 at 2:10 pm
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,...
May 7, 2008 at 2:05 pm
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...
May 5, 2008 at 1:05 pm
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...
May 5, 2008 at 1:02 pm
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,...
May 5, 2008 at 12:58 pm
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(
...
May 5, 2008 at 9:09 am
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...
May 5, 2008 at 8:43 am
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...
May 5, 2008 at 8:28 am
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...
May 5, 2008 at 8:12 am
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-' +...
May 5, 2008 at 7:51 am
Viewing 14 posts - 106 through 119 (of 119 total)