Viewing 5 posts - 1 through 5 (of 5 total)
You can do without joins with a little bit of trickery:
SELECT ProjectNo,
CAST(SUBSTRING(MIN(CONVERT(VARCHAR,DateStarted,112) + IssueNo),9,10) AS INT) IssueNo,
MIN(DateStarted) DateStarted
FROM Projects
GROUP BY ProjectNo
By taking the minimum of DateStarted + IssueNo and strip off the IssueNo...
May 9, 2006 at 6:12 am
If you rewrite the function and let it return the Codes string with intMasterAcctID as a parameter then you can do something like this:
SELECT intMasterAcctID, dbo.WarrantCodesByAcct(intMasterAcctID)
FROM MasterRecord
April 8, 2004 at 2:25 am
You can use a powerful but little-known technique, namely a running update with variables:
DECLARE @Sales DECIMAL(10,2), @MV DECIMAL(10,2)
SELECT @Sales = 0, @MV = 0
UPDATE Table1
SET @MV =...
December 11, 2003 at 2:20 am
You could code and store the different product combinations as bitmasks, where each product corresponds to a bit of the bitmask (A=1, B=2, C=4, etc.). For 3 products there are...
May 8, 2003 at 7:49 am
Self joins and subselects can be avoided by using the following query:
SELECT Name, RIGHT(MIN(Grade + CAST(TestNo AS VARCHAR)),1), MIN(Grade), SUBSTRING(MIN(Grade + CAST(TestNo AS VARCHAR) + Comment),3,50)
FROM...
December 16, 2002 at 4:38 am
Viewing 5 posts - 1 through 5 (of 5 total)