Viewing 15 posts - 1,126 through 1,140 (of 2,007 total)
I believe what you're after is this: -
SELECT VISIT_DATE, COUNT(VISIT_DATE) AS [Count]
FROM (SELECT VISIT_DATE
FROM XXOH_AMT
GROUP BY Visit_Date, PATIENT_ID)...
December 20, 2011 at 1:45 am
GSquared (12/15/2011)
[SNIP]blamed the devs
[SNIP]
blame the devs.
[SNIP]
That's the devs fault.
[SNIP]
blame the devs.
[SNIP]
Blame the devs.
[SNIP]
Blame the devs.
[SNIP]
Blame the devs.
[SNIP]
Or blame the devs.
I think you must have gone to school with the DBA...
December 15, 2011 at 6:41 am
DECLARE @givenDate AS DATETIME
SET @givenDate = '2011-11-05'
SELECT DATEADD(d,-1,DATEADD(mm, DATEDIFF(m,0,@givenDate)+1,0)), --As date
DAY(DATEADD(d,-1,DATEADD(mm, DATEDIFF(m,0,@givenDate)+1,0))) --As days
DECLARE @givenMonth AS INT
SET @givenMonth = '11'
SELECT DAY(DATEADD(d,-1,DATEADD(mm, DATEDIFF(m,0,(DATEADD(mm, @givenMonth-1, 0)))+1,0)))
December 15, 2011 at 6:15 am
omi_real (12/14/2011)
Cadavre:Is their any other way,
the computer hanged-out
due to many IIF.
I think their are other ways,
help!
🙂
Pivot ?
December 15, 2011 at 1:30 am
I felt you needed a reply, as you've provided us with DDL and sample data so I've had a go.
There's a possibility I haven't understood your problem correctly, so test...
December 14, 2011 at 10:03 am
You're trying to GROUP BY *, which you can't do. You have to explicitly state each column.
December 14, 2011 at 7:48 am
mic.con87 (12/14/2011)
Yes it maintains the convention that you mentioned 🙂
Good 😉
Did this script work for you?
SELECT --it.*, cqv.QuestionID, cqv.Question, cqv.Answer
it.NameID, it.IncidentDate, it.ClaCaseID,
MAX(CASE WHEN cqv.QuestionID = 1 THEN cqv.Answer ELSE NULL...
December 14, 2011 at 6:57 am
OK, one more question 😀
Is the Question ID always 1 for 'Did did the incident occur at night', always 2 for 'Were there any witnesses' and always 3 for 'Who...
December 14, 2011 at 6:42 am
Jeff Moden (12/14/2011)
December 14, 2011 at 6:36 am
I think you're on the right track. I think I'd have a timezone table and a daylight savings table as lookups, rather than just a timezone table.
December 14, 2011 at 5:40 am
You've missed things in your sample data.
The code you use to get the current result is as follows (from your post, but corrected to use the temp tables you provided).
SELECT...
December 14, 2011 at 5:22 am
Use RIGHT('0' + yourData, 2)
e.g.
SELECT RIGHT('0' + test,2), test
FROM (SELECT '1' UNION ALL SELECT '2' UNION ALL
SELECT '3' UNION ALL SELECT '4' UNION ALL
...
December 14, 2011 at 4:43 am
BEGIN TRAN
--First, let's create some sample data to play with!!
SELECT [Claimant Number], --This comes from your sample data
(ABS(CHECKSUM(NEWID())) % 100) + 1 AS [Claim Number], --This is a pseudo-randomly generated...
December 14, 2011 at 2:49 am
mic.con87 (12/14/2011)
December 14, 2011 at 1:52 am
Jeff Moden (12/13/2011)
December 14, 2011 at 1:50 am
Viewing 15 posts - 1,126 through 1,140 (of 2,007 total)