Viewing 15 posts - 16 through 30 (of 149 total)
Glad I could help. It is always helpful to have another set of eyes look at things.
Dave
April 28, 2008 at 7:06 am
Try this:
SELECT pStart, MAX(txnDate) AS txnDate
FROM Period p INNER JOIN TXN t ON p.[Key] = t.[Key]
GROUP BY pStart
Dave Novak
April 25, 2008 at 2:29 pm
Try this:
CREATE PROCEDURE p_Get_Filtered (
@LineFilter varchar(50),
@StatusFilter varchar(50),
@MTDGreaterThan decimal(15,2),
@MTDLessThan decimal(15,2),
@QTDGreaterThan decimal(15,2),
@QTDLessThan decimal(15,2),
@AchieveLevelStart int,
@AchieveLevelEnd int)
SET NOCOUNT ON
DECLARE @LineTable table (Line int)
DECLARE @MTDGreater decimal(15,2),
@MTDLess decimal(15,2),
@QTDGreater decimal(15,2),
@QTDLess decimal(15,2)
--Code to build temp table #DLFiltered goes...
April 25, 2008 at 11:30 am
Give this a try:
SELECT PersonId,
CASE WHEN c.EmailId = -1 THEN e.EmailAddress ELSE NULL END AS PreferredEmail,
CASE WHEN c.PostalAddressId = -1 THEN p.Address ELSE NULL END AS PreferredAddress
FROM tContacts c
LEFT JOIN...
April 25, 2008 at 8:18 am
For these situations, I use one central SQL Server as a repository for the info from all the other servers. Since you have SQL Server 2005, I would use...
April 25, 2008 at 7:40 am
What Steve is saying is the the 'SET ROWCOUNT' command while achieve what you want to do.
Here is an example using your situation:
DECLARE @NumRecs int, @Value varchar(25)
SET @NumRecs = 100
SET...
April 25, 2008 at 7:33 am
What is being passed into the variable '@LineFilter' that it is ignore the final else?
April 24, 2008 at 7:06 am
Indirectly, yes it is possible to restore just one table.
Directly, no you can not restore just one table from a database.
Indirectly, you restore the database as a different name or...
April 23, 2008 at 1:34 pm
You need to use 'IF .. ELSE IF ... ELSE IF ... ELSE'
IF @LineFilter = ('Only Line 1')
...
April 23, 2008 at 1:22 pm
Try this:
IF @LineFilter = ('Only Line 1')
BEGIN
(SELECT * FROM #DLFiltered
WHERE Active = 1
AND...
April 22, 2008 at 2:59 pm
Make the IF statement as follows:
IF @LineFilter = ('Only Line 1')
AND EXISTS (SELECT NULL FROM .... WHERE .......)
BEGIN {Insert statement and select statement}
...
April 22, 2008 at 2:35 pm
GSquared is right, the if exists clause is better.
this would look like this:
IF EXISTS (SELECT NULL FROM #DLFiltered
WHERE Active = 1
AND DownlineLevel = 1
...
April 22, 2008 at 1:46 pm
If you are trying to breakdown the size field of the SYSFILES system table to GB, here is a breakdown of how to do it.
The size column is the number...
April 22, 2008 at 1:13 pm
Good luck. Let me know if you need any help.
Dave Novak
April 22, 2008 at 11:37 am
Art,
IF @LineFilter = ('Only Line 1')
SELECT * from #DLFiltered WHERE Active = 1
...
April 22, 2008 at 10:49 am
Viewing 15 posts - 16 through 30 (of 149 total)