Viewing 15 posts - 961 through 975 (of 1,082 total)
Hi 🙂
Here is what you are looking for:
SELECT CONVERT (VARCHAR(13),@Vdt,103)
Please remember that it 99% of the time a better option to format dates on the Client side with the...
January 10, 2008 at 8:30 am
Hi Guys,
How about trying this in 2000
SELECT
[1].Col1
,[1].Col2
,[1].Col3
,[1].Col4
,[Max]
FROM dbo.Temp [1]
INNER JOIN (SELECT Col1,Col2,Col3,MAX(Col4) as [MAX] FROM dbo.Temp GROUP BY Col1,Col2,Col3) [2]
ON [1].[Col1] = [2].Col1
AND [1].[Col2] = [2].Col2
AND [1].[Col3] = [2].Col3
Thanks
Chris
January 4, 2008 at 7:30 am
Hi,
Yip that is only in 2005. Sorry what version is being used for this problem?
Thanks
Chris
January 4, 2008 at 5:46 am
HI All,
Have you tried using the OVER clause?
Something like this should get you on your way.
SELECT
date
,store
,Trans_number
,prod_number
,random
,MAX(random ) OVER(PARTITION BY date ,store,Trans_number ) AS 'Max'
FROM dbo.YourTable
Thanks
Chris
January 4, 2008 at 5:29 am
HI MarkC ,
that is perfect 10000% correct and so simple.
Sorry I missed that. Didn't realise you could use partition and a order by in a over clause 🙂
thanks again.
November 2, 2007 at 5:44 am
HI All,
Here is another way to create a numbers table.
Prob a good Idea to have a perm one in your db.
SELECT TOP 100000
...
October 25, 2007 at 7:16 am
HI there
Is this the kind of thing you looking for?
--http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=76033
SET NOCOUNT ON
DECLARE @VvcAgencyName VARCHAR(max)
SELECT @VvcAgencyName = 'a b c d e f'
CREATE TABLE #Numbers
(
[number] [int],
CONSTRAINT [Index_Numbers] PRIMARY KEY CLUSTERED
([number] ASC)...
October 25, 2007 at 6:23 am
I think it's pretty straight forward
Table A
Row1: ColA = 1
Row2: ColA = 2
Table B
Row1: ColB = 1
Row2: ColB = 2
Row3: ColB = 3
SELECT * FROM A INNER JOIN B ON...
October 25, 2007 at 5:58 am
That is correct.
The user could click page 10 in which case we would need to show all the rows for that page.
So I guess the correct question is.
Would returning 700,000...
October 22, 2007 at 2:57 am
Hi,
There are a few postings and articles for delimiting strings into tables.
here is one that I saw the last time this someone brough this topic.
hope it helps
October 17, 2007 at 5:34 am
THis should do the trick:
SELECT LEFT(NameCode, LEN(NameCode)-6)
October 11, 2007 at 5:23 am
Sorry about that.
Query one takes 66%
Query two takes 34%
thanks for the advice everyone
October 9, 2007 at 8:18 am
Hi,
I'm a little confused.
If you return the ID's then your count will be affect because of the group by.
Unless what you looking to do is a partition?
Could you give me...
October 3, 2007 at 8:24 am
Hi,
have you tried this:
SELECT
ID
,[2007-10-03] as [2007-10-03]
,[2007-10-04] as [2007-10-04]
FROM
(
SELECT
ID
,ID as [tmp]
,DATE
,[DATA]
FROM MyTable
) p
PIVOT(MAX([DATA])
FOR DATE in ([2007-10-03],[2007-10-04])
) as pv
thanks
Chris
October 2, 2007 at 4:50 am
Viewing 15 posts - 961 through 975 (of 1,082 total)