Viewing 15 posts - 5,596 through 5,610 (of 6,036 total)
That's a problem.
Server may exist, and be accessible from application, but not accessible from the server where SP is trying to create the view. For example, because of Firewall settings.
That's...
February 17, 2006 at 7:28 pm
My query does not depend on DATEFIRST settings.
February 17, 2006 at 6:26 pm
I mean get (-1)%7, not get (-1)/7
And what you expect to get when 2 dates are the same?
There are no Mondays between them, so it must be 0.
What's wrong with...
February 17, 2006 at 6:51 am
There is no way to get (-1)%7 in my formula.
Both @@Datefirst and Datepart(dw,@endDate) are positive values, their SUM is >= 2.
And for both dtes '2005-12-31' it returns 0 which...
February 17, 2006 at 6:21 am
OK.
@EndDate - (@@Datefirst+Datepart(dw,@EndDate)-2) %7
gives you last Monday before @EndDate.
Datediff(dd, @StartDate, @EndDate - (@@Datefirst+Datepart(dw,@EndDate)-2) %7) / 7
gives you result.
The only thing you need to adjust is number of Mondays between 2...
February 17, 2006 at 4:09 am
Can you make an estimation how long it will take to run a cursor over 20 million rows firing trigger doing update with derived table on the same table with...
February 17, 2006 at 2:43 am
Not sure it will work, but why not try?
SET @sql = insert into #TempJobTable
EXEC('execute sp_help_job @category_name=N''REPL-Merge'', @enabled=1, @execution_status=4')
February 16, 2006 at 9:18 pm
Run
select (@@Datefirst + Datepart(dw, YourDateField) - 2) %7 +1
FROM ..
with different Datefirst settings and see what you can get from it.
February 16, 2006 at 4:37 pm
Add
GROUP BY T2.DayNumber
at the end of my script.
For 6 hours you can use
datediff(hh, 0, datetimestamp) / 6
Because all values are int it will return number of 6 hours...
February 16, 2006 at 3:01 pm
From BOL: (what's an idea to read it time to time!
)
Returns the workstation name.
HOST_NAME ( )
nchar
February 16, 2006 at 2:43 pm
HAVING to be used only with aggregated values.
WHERE is right in this case.
Distinct is redundant if you are using GROUP BY.
SELECT u2.EMPLOYID, u1.TRXBEGDT, u1.TRXENDDT
FROM UPR30300 u1 INNER JOIN
UPR30100 u2 ON...
February 16, 2006 at 2:36 pm
Actually you don't need any flag.
Select count(T1.barcode) as NumberOfMembers, dateadd(dd, T2.DayNumber, 0) as DateRecorded
FROM MyTable T1
INNER JOIN (
select barcode, datediff(dd, 0, datetimestamp) DayNumber -- if your time span is...
February 16, 2006 at 2:06 pm
Why not
INSERT INTO #usertable EXEC ('SELECT * FROM users WHERE ... ')
February 15, 2006 at 8:21 pm
Select SUM(case when type = 'White' then Num_Avail else NULL end) as Available_White, SUM(case when type = 'Blue' then Num_Avail else NULL end) as Available_Blue, SUM(Num_Avail) as Total...
February 15, 2006 at 5:57 pm
If you return int you not gonna have 00455, it will be just 455.
If you really need 00455 it must be varchar.
February 15, 2006 at 3:48 pm
Viewing 15 posts - 5,596 through 5,610 (of 6,036 total)