Viewing 15 posts - 946 through 960 (of 1,229 total)
Try this - it might not give you exactly what you need but it will be close enough for you to correct:
SELECT policy, currency, sequence, amount,
GroupID = DENSE_RANK() OVER(PARTITION...
April 18, 2011 at 10:05 am
Ringo-394296 (4/18/2011)
April 18, 2011 at 9:38 am
Phineas Gage (4/18/2011)
ChrisM@home (4/18/2011)
declare @Last7Days CHAR(8)
SELECT @Last7Days = CAST(YEAR(CURRENT_TIMESTAMP - 7) * 10000 + MONTH(CURRENT_TIMESTAMP - 7) * 100 + DAY(CURRENT_TIMESTAMP - 7) AS CHAR(8))
SELECT...
April 18, 2011 at 9:16 am
Is there any advantage in includeing all of the columns in that index? Have you tried the same index with no included columns?
April 18, 2011 at 9:10 am
Plan B, using Lowell's code:
declare @Last7Days CHAR(8)
SELECT @Last7Days = CAST(YEAR(CURRENT_TIMESTAMP - 7) * 10000 + MONTH(CURRENT_TIMESTAMP - 7) * 100 + DAY(CURRENT_TIMESTAMP - 7) AS CHAR(8))
SELECT ...
WHERE table-name-removed >=...
April 18, 2011 at 9:01 am
Double check the datatype of that INT date column. I reckon it's a text type, not an INT.
@ninja - good spot, mate - you saw this coming 🙂
April 18, 2011 at 8:55 am
Try it with the quotes.
April 18, 2011 at 8:49 am
You're nearly there...check out RANK() and DENSE_RANK().
April 18, 2011 at 8:46 am
Phineas Gage (4/18/2011)
ChrisM@home (4/18/2011)
How long does it take to run this:
WHERE table-name-removed >= '20110411'1 second...see comments above
Did you include the single quotes around the number?
April 18, 2011 at 8:44 am
How long does it take to run this:
WHERE table-name-removed >= '20110411'
April 18, 2011 at 8:37 am
Ryan Keast (4/18/2011)
I am importing the following example of data into a SQL 2000 database -
01|171|Fri|A0277730|.03|1|.0333|JOBS|03/12/10||
01|171|Fri|A0277742|.03|2|.0333|JOBS|03/12/10||
01|193|Mon|A0277843|1.45|1|1.4499|JOBS|06/12/10||
01|193|Mon|A0278032|.03|2|.0333|JOBS|06/12/10||
01|193|Mon|A0278054|.23|3|.2333|JOBS|06/12/10||
01|193|Mon|A0278256|1.48|4|1.4833|JOBS|06/12/10||
When imported the data is being held as .03 and .23 as examples.
How...
April 18, 2011 at 8:17 am
Jeff Moden (4/18/2011)
ChrisM@home (4/18/2011)
nikplic (4/17/2011)
April 18, 2011 at 7:58 am
nikplic (4/17/2011)
April 18, 2011 at 6:22 am
sunnymalhotra (4/18/2011)
If exists (select idbatch from jbjob inner join insts_temp on insts_temp.inst = jbjob.idInst and insts_temp.BusDate = jbjob.BusinessDate and jbjob.idbatch=40)
Begin
...
April 18, 2011 at 3:50 am
Hi Sunny
Posting your solution may help others with a similar problem - also, it would allow the community to verify your solution and if necessary make further recommendations.
April 18, 2011 at 1:59 am
Viewing 15 posts - 946 through 960 (of 1,229 total)