Viewing 15 posts - 2,986 through 3,000 (of 6,486 total)
You probably want to be careful about DATEPART(weekday), since its return can be affected by the DATEFIRST setting.
So - consider using:
SELECT *
FROM @RESULTS
where datediff(day,'19000106',[DATE])%7>1
ORDER BY StudentID, [DATE]
June 10, 2008 at 1:23 pm
If you're willing to "pay" to not have to rewrite the change scripts - look into Team Suite for Database Developers. By setting up a "database project" - you...
June 10, 2008 at 1:16 pm
The following is what is making the query whine:
convert(datetime,convert(varchar(2),datepart(mm, [date])) + '/01/' + convert(varchar(4),datepart(yy, [date])))
You probably need to add [date] or that entire calc to your GROUP BY statement.
June 10, 2008 at 1:14 pm
I'll save you the pain - that won't work against compat=80....:D
Actually - neither will. Those are both "compatibility 90" options...
June 10, 2008 at 1:07 pm
If you'd rather get away from DATEPART(weekday), (which is affected by the DATEFIRST setting on the server, do a simply math calc from a known Saturday:
select datediff(day,'19000106',getdate())%7
Anything with a value...
June 10, 2008 at 1:01 pm
I'm not sure I follow - you mention 6 physical drives, mapping to 4 logical drives, and yet the policy it to allow only 2?
If the standard is in fact...
June 10, 2008 at 12:33 pm
Trent - your big issue is to be able to pick out the top 3 per group. Once you have them - the averages are easy.
Well - in this...
June 10, 2008 at 11:09 am
Todd - assuming that we're dealing with SQL2005, you actually have a few options. One is the "xml trick" - which looks something like this:
SELECT t1.SomeID,
...
June 10, 2008 at 10:56 am
You may be right - I hadn't seen that specific distinction previously (that looks to have been changed from the last time I read it).
One way or the...
June 10, 2008 at 9:37 am
Kevin Lewis (6/10/2008)
Whats the difference in execution between the following? Or do they all have the same costs?
SELECT count(primary_ID) FROM dbo.tblOfMine
SELECT count(1) FROM dbo.tblOfMine
SELECT...
June 10, 2008 at 8:57 am
Jeff beat me to it - but that does sound an awful lot like a foreign key error.
June 8, 2008 at 9:28 pm
For better or worse - running a function like that will usually end up being very slow. In my experience, functions (T-SQL functions that is) are NOT know for...
June 8, 2008 at 10:00 am
Nice one! At the risk of stating the obvious - I wasn't nearly that inspired when I picked mine....:D Good to see someone who was!
June 7, 2008 at 12:13 pm
Thanks! Been dabbling with the windowed stuff for a little bit - trying to figure them out.
And - I do like the handle - story teller is always...
June 6, 2008 at 8:48 pm
Raconteur (6/6/2008)
Maybe I am doing something wrong, but I am getting the total of all promo_disc_amt for every line in the criteria, including the dupes.
If I do:
SELECT DISTINCT order_key,...
June 6, 2008 at 12:18 pm
Viewing 15 posts - 2,986 through 3,000 (of 6,486 total)