Viewing 15 posts - 9,376 through 9,390 (of 10,144 total)
Garadin (11/18/2008)
November 19, 2008 at 9:43 am
You're welcome. Does it work now? If so, it would be beneficial to post your completed query here - you never know when someone else is going to come up...
November 19, 2008 at 8:50 am
Your colleagues version is exactly what I would have done pre tally-tables.
Incidentally, this...
Substring(Cast(l.LogDate as nvarchar), 1, 11) = t.logdate
could be a performance killer, SQL Server won't know if a...
November 19, 2008 at 8:48 am
Have you considered writing it like this...
[font="Courier New"]UPDATE [AppUsers]
SET [Username] = @NewUsername
WHERE [Username] = @OldUsername
AND @OldClassification = ''
AND @OldMerchant = ''
UPDATE [AppUsers]
...
November 19, 2008 at 8:35 am
Hi Chris
It's because there's a time component in LogDate. Using a range takes care of this:
[font="Courier New"]SELECT DATEADD(DAY, n.number-1, @StartDate) AS CalcLogDate,
COUNT(DISTINCT(ProcessID)) AS ProcessCount
FROM Numbers n
LEFT JOIN #LogEntry l...
November 19, 2008 at 8:12 am
What happens when you run this simplified version of your query? If you supply some sample data then forum members will be able to test themselves.
[font="Courier New"]
DECLARE @HieID -- assign...
November 19, 2008 at 7:30 am
DECLARE @bit BIT
SET @bit = 0 -- or 1, or comment out
SELECT @bit AS BitValue, CASE @bit WHEN 1 THEN 'Y' WHEN 0 THEN 'N' ELSE NULL END AS YesNo...
November 19, 2008 at 7:16 am
sqluser (11/19/2008)
i am getting the following error while executing the procedure.The statement terminated. The maximum recursion %d has been exhausted before statement completion.
Please help to solve the problem.
There is insufficient...
November 19, 2008 at 7:04 am
Token matching works quite well...
[font="Courier New"]DROP TABLE #Table
CREATE TABLE #Table (TheValues VARCHAR (20))
INSERT INTO #Table (TheValues)
SELECT '0010' UNION ALL
SELECT '11242' UNION ALL
SELECT '0011246' UNION ALL
SELECT '0011264' UNION ALL
SELECT...
November 19, 2008 at 5:43 am
Hi Chris
Do you have a tally (numbers) table? If so, try this:
[font="Courier New"]DECLARE @StartDate DATETIME, @EndDate DATETIME
SET @StartDate = 'Nov 01 2008'
SET @EndDate = 'Dec 01 2008'
SELECT DATEADD(DAY, n.number-1, @StartDate)...
November 19, 2008 at 4:51 am
Can you UPDATE tempTable? If so, you could use the running totals solution:
http://www.sqlservercentral.com/articles/Advanced+Querying/61716/
Cheers
ChrisM
November 19, 2008 at 4:13 am
Try this:
ORDER BY CASE WHEN ISNULL(DateAmended, DateCreated) > DateCreated THEN DateAmended ELSE DateCreated END DESC
November 19, 2008 at 4:10 am
Hi Michael
I don't think this could be converted into a view in the exact way that you've suggested because the parameters are required for the derived table, i.e. before the...
November 19, 2008 at 2:48 am
Hi John
Compare the SELECT component of each statement.
Row count
Values if you feel it is necessary
Time.
This is what I mean by the SELECT component:
[font="Courier New"]SELECT [P].[LAST_PAYMENT_DATE]
,.[NEXT_PAYMENT_DATE]
,[P].[CUR_PAYMENT]
,.[AVG_PMT_FREQ]
FROM [dbo].[Amortization]...
November 19, 2008 at 2:14 am
Viewing 15 posts - 9,376 through 9,390 (of 10,144 total)