Viewing 15 posts - 3,496 through 3,510 (of 3,957 total)
I believe your query will run as follows:
select s.stud_code, s.given_name,s.surname,s.year_grp,form_cls,s.dol
from Students s
inner join
(select stud_code, x=count(*)
from Students as c
where dol between @StartDate and @EndDate
and cmpy_code='01'
group by stud_code
having count(*)...
May 28, 2012 at 1:03 am
I think there's more issues here than just the syntax error:
1. DOL is a datetime (presumably), so why the test on DOL <= '5'?
2. Where is the ON following the...
May 27, 2012 at 11:09 pm
Jeff Moden (5/25/2012)
dwain.c (5/15/2012)
Jeff Moden (5/15/2012)
Shifting gears back to the subject at hand... there's...
May 25, 2012 at 5:45 pm
You have no idea what a time-saver you just posted for me. I needed to search out that very same gaps and islands article for something else I'm working...
May 25, 2012 at 4:53 am
R.P.Rozema (5/25/2012)
May 25, 2012 at 1:04 am
Yet another method that works but is ugly and probably not recommended. I like my previous one better.
SELECT @xml1 = (SELECT * FROM @t FOR XML PATH(''))
-- Add in...
May 25, 2012 at 1:02 am
Jeff Moden (5/24/2012)
dwain.c (5/24/2012)
May 24, 2012 at 11:43 pm
Jeff Moden (5/24/2012)
dwain.c (5/24/2012)
...so what makes you think I could do so here?
Not sure. You DO have a love for rCTEs and I'm thinking that you'll pull a rabbit...
May 24, 2012 at 11:00 pm
Jeff Moden (5/24/2012)
dwain.c (5/24/2012)
Jeff Moden (10/24/2010)
May 24, 2012 at 9:55 pm
Jeff - I've been a fan of this splitter for a long time even though I've been a slow adopter, 🙂 recommending it highly around my office at any opportunity.
I...
May 24, 2012 at 9:18 pm
dwain.c (5/24/2012)
Would it be possible to store each...
May 24, 2012 at 8:27 pm
Mark-101232 (5/24/2012)
R.P.Rozema (5/24/2012)
May 24, 2012 at 8:13 pm
Mark-101232 (5/24/2012)
WITH CTE AS (
SELECT row.value('local-name(.)', 'VARCHAR(50)') AS name
,row.value('text()[1]', 'VARCHAR(50)') AS val
...
May 24, 2012 at 8:02 pm
Another option:
DECLARE @t TABLE (Names VARCHAR(20))
INSERT INTO @t
SELECT 'sarat' UNION ALL SELECT 'Sarat' UNION ALL SELECT 'SaRaT' UNION ALL SELECT 'SARAT'
SELECT Names, CASE WHEN Names2=LOWER(Names2) THEN 1 ELSE 0 END...
May 24, 2012 at 6:54 pm
Viewing 15 posts - 3,496 through 3,510 (of 3,957 total)