Viewing 15 posts - 61 through 75 (of 600 total)
Ron Kunce (3/5/2015)
March 5, 2015 at 9:06 am
Can you post what you would want the query output to look like?
To me. your 'Tuesday or Friday' thing is a bit unclear. I mean, you could say,...
March 5, 2015 at 8:58 am
Short answer, yes its possible.
But to actually do it we'd probably need a detailed example. Ideally DDL for the affected tables, some sample data and expected output.
Your outer...
March 5, 2015 at 7:43 am
The CHARINDEX gives you a 0 if there is no --
When you use 0 as the start position for substring it messes it up. Here is the MSDN page...
March 4, 2015 at 2:35 pm
Thanks!
Started doing it with a CTE for the max(case) and then it just occurred to me that I really didn't need it to be in a CTE just to apply...
March 4, 2015 at 2:17 pm
For starters:
SELECT PERSID,
CASE MAX(CASE DUESTATUS
WHEN 'Overdue' THEN 2
WHEN 'DUE' THEN 1
ELSE 0
END)
WHEN 2 THEN 'Overdue'
WHEN 1 THEN 'Due'
ELSE 'Unknown'
END DUESTATUS,
CASE MAX(CASE COMPSTATUS
WHEN...
March 4, 2015 at 11:12 am
Being that you only want to give us 7 sample rows, maybe just copy and paste the insert statement for us together?
We can keep playing null detective instead, but if...
March 4, 2015 at 9:18 am
Try
SELECT 'SELECT '
+ COALESCE(QUOTENAME(user_name,''''),NULL)+','
+ COALESCE(QUOTENAME(date_of_change,''''),NULL)+','
+ COALESCE(QUOTENAME(time_of_change,''''),NULL)+','
+...
March 2, 2015 at 9:20 am
I'm glad it worked for you.
March 1, 2015 at 9:32 pm
Ok, so lets add in a condition to ignore the last 5 columns. If these are always the last 5 it should work.
DECLARE @Query nvarchar(max),
@tablename nvarchar(50)=N'Rheumatology'
;
-- First we build...
March 1, 2015 at 8:24 pm
All 5 of these columns will be the same always
Does this mean that these will be the last five columns in every table always, or just this table always?
March 1, 2015 at 5:40 pm
The problem is here:
[Composite Score Eligible ] [nvarchar](255) NULL,
[Composite Score] [nvarchar](255) NULL,
[Composite Score PGS Percentage] [nvarchar](255) NULL,
[coremeasure] [bit] NULL,
[pediatric] [bit] NULL
These 5 fields at the end do not fit the...
March 1, 2015 at 4:08 pm
Lol, ignore the enough for 12 years. Instead of retyping the inline tally code, I stole it from another solution (one of Luis')
Missed that comment and left it in.
Please do...
March 1, 2015 at 11:16 am
This is one of many problems you can solve pretty easily with a calendar table.
You can read about them here[/url].
I will use Dwain's generate calendar function for my sample solution...
February 28, 2015 at 11:04 pm
Viewing 15 posts - 61 through 75 (of 600 total)