Viewing 15 posts - 6,076 through 6,090 (of 10,144 total)
eh.shams (7/10/2012)
SELECT @90000119Sum = @Avamel
"@90000119Sum" this is variable i declare it,@Avamel is belong to cursor as shown in top
in cursor but give me this error...
July 10, 2012 at 4:45 am
najeeb_kt2000 (7/10/2012)
This Sql give errorMsg 102, Level 15, State 1, Line 2 ,Incorrect syntax near '‘'.
why this problem.
Please respond to Gail's post before we continue with correcting the syntax...
July 10, 2012 at 4:44 am
The problem is with the single-quoted parameters. Use PRINT @sqlcommand instead of EXEC(@sqlcommand) and examine the statement.
July 10, 2012 at 4:05 am
eh.shams (7/10/2012)
i know it , but i need it value in cursor
Why do you need a cursor? Surely you just need the value in a variable?
SELECT @Variable = column FROM...
July 10, 2012 at 3:59 am
sqlzealot-81 (7/10/2012)
Hi ,I have a req as follows:
My table structure is something like below:
TestIDDistinctionFirstSecond
10185%60%50%
10250%85%NULL
10350%60%85%
I want my result as following:
TestID50%60%85%
101SecondFirstDistinction
102DistinctionNULLFirst
103DistinctionFirstSecond
Appreciate your help.
DDL and DML?
CREATE TABLE #Sample (TestID ...
INSERT INTO #Sample ...
July 10, 2012 at 3:38 am
Surely this is sufficient:
SELECT SUM(Avamel)
FROM V_Factor_Total4
WHERE cslPricingFactorRef = '90000119'
July 10, 2012 at 3:12 am
Jay
I don't see anything cumulative yet - the result sets you've posted are simple aggregates:
SELECT
Docket_Category,
[Count],
[Percentage] = CAST(100*[Count]/(Total*1.00) AS NUMERIC(4,2))
FROM (
SELECT
Docket_Category,
[Count] = COUNT(*),
Total = SUM(COUNT(*)) OVER(PARTITION...
July 10, 2012 at 3:01 am
As long as you will never go beyond four or five columns, the following query works well. Otherwise Google delimitedsplit8k.
-- sample data
;WITH SampleTable AS (
SELECT Stringybit = 'part1 area 2...
July 9, 2012 at 9:56 am
jerome.morris (7/9/2012)
What query do you want me to run for the result you want to see
...
Make up the results. Use the sample data set you've posted as your source, run...
July 9, 2012 at 9:24 am
jerome.morris (7/9/2012)
This is what the end result I am after is but using Categoryhttp://www.brighthub.com/office/project-management/articles/8708.aspx
The link may help you to help me as I cant explain it detailed enough
Jay
Ok, interesting...how...
July 9, 2012 at 9:07 am
Hi Jay, that's great, thanks. How about a table of expected output?
July 9, 2012 at 8:52 am
Hi Jay, try reading the link in my sig "please read this". It will describe to you how to set up some sample data for folks to test solutions against....
July 9, 2012 at 8:18 am
-- sample data. I reckon a [quantity] column is missing.
-- so calculating over [Docket_Id] instead.
DROP TABLE #DocketTB
SELECT *
INTO #DocketTB
FROM (
SELECT Docket_Category = 'Mechanical', Docket_Id = 49 UNION...
July 9, 2012 at 7:34 am
krypto69 (7/9/2012)
How do I remove the time portion from my date/time results?
SELECT CAST(FLOOR(CAST(EecDateOfLastHire AS FLOAT)) AS DATETIME) from empcompgives me:
1984-08-13 00:00:00.000when what I want is:
1984-08-13
It's not possible without...
July 9, 2012 at 7:18 am
jerome.morris (7/9/2012)
July 9, 2012 at 7:13 am
Viewing 15 posts - 6,076 through 6,090 (of 10,144 total)