Viewing 15 posts - 1,276 through 1,290 (of 2,007 total)
Since this post seems to not want to die, here's an update of the test script I posted before to include the unique solutions posted since.
BEGIN TRAN
--1,000,000 Random rows of...
November 25, 2011 at 7:22 am
methexis (11/25/2011)
So the result should look something like this
1234 CompanyX US 0.5
1234 CompanyX EU 0.5
4321 ...
November 25, 2011 at 5:26 am
methexis (11/25/2011)
The error I am guessing is here
SUM (a.Pass/(COUNT (ACCGRPNUM))) as RATE
using the ACCGRPNUM to get the total number of locations by Region kicks...
November 25, 2011 at 4:16 am
rktn_odin (11/24/2011)
LutzM (11/24/2011)
SELECT Date2 AS DateOutput FROM YourTable ??It's most probably not the code you're looking for, but it's a valid solution based on your sample data... You might want...
November 25, 2011 at 4:06 am
Ninja's_RGR'us (11/23/2011)
Dev (11/23/2011)
(XYZ is still waiting for thanks :hehe:).
The most prolific poster post because it's the RIGHT thing to do. Not to get anything of any kind...
November 25, 2011 at 3:59 am
SameerKKhan (11/25/2011)
i have one more query.Can i get the Date and Hour using a Query.
I want to Insert the Date along with the hour part in the Table.Like...
November 25, 2011 at 3:52 am
SameerKKhan (11/25/2011)
i have one more query.Can i get the Date and Hour using a Query.
I want to Insert the Date along with the hour part in the Table.Like...
November 25, 2011 at 3:46 am
Off the bat it looks like you're missing a GROUP BY (formatted you code below)
USE DQ_RefData
-- Calculate %--
SELECT ACCGRPNUM, ACCGRPNAME, REGION,
SUM(a.Pass / (COUNT(ACCGRPNUM))) AS RATE
-- LOCATIONS THAT MEET CRITERIA--
FROM...
November 25, 2011 at 3:39 am
oliver.morris (11/25/2011)
Hopefully a simple question for friday morning, but I have no clue in SQL how to do this,Many Thanks for the help,
Oliver
Something like this?
DECLARE @TABLE AS TABLE (string VARCHAR(50))
INSERT...
November 25, 2011 at 3:22 am
SameerKKhan (11/25/2011)
cant i use the- convert(varchar(10),getDate,111) to...
November 25, 2011 at 3:14 am
BEGIN TRAN
CREATE TABLE companies (id INT)
INSERT INTO companies
SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3
SELECT CAST('<img href="http://google.com/' + CAST(id AS VARCHAR(50)) + '_thumb.jpg" />' AS XML) AS
FROM...
November 25, 2011 at 2:52 am
SameerKKhan (11/25/2011)
i want to add another filter to the Query i.e the Date.There is a Date column in Attendance.
I want to get...
November 25, 2011 at 1:42 am
You're using "your" proc incorrectly.
DECLARE @MyPeriod INT
SET @MyPeriod = CONVERT(INT, '201103')
SET @MyPeriod = CASE WHEN @MyPeriod BETWEEN 175301 AND 999912 AND @MyPeriod % 100 BETWEEN 1 AND 12
...
November 24, 2011 at 9:14 am
rootfixxxer (11/24/2011)
I was testing here some data with dates, but then i realize that sql server rounds the seconds, when converting from a string to a datetime/smalldatetime.
What's the "problem"/logic behind...
November 24, 2011 at 9:01 am
Viewing 15 posts - 1,276 through 1,290 (of 2,007 total)