Viewing 15 posts - 1,411 through 1,425 (of 3,957 total)
I was assuming you dynamically built the query in the front end so could handle splitting the items that are part of the IN clause.
Alternatively, something like this will also...
September 26, 2013 at 8:00 pm
Sean Lange (9/26/2013)
select Rate
from @T
cross apply (select count(*) as RowsCount from @t where rate...
September 26, 2013 at 7:47 pm
Personally, if I couldn't correct it on data capture and in the table definition, I'd probably convert it to a TIME data type and do my validation from there.
SELECT *
...
September 26, 2013 at 7:19 pm
How about this?
SELECT field1, field2, field3
FROM table
WHERE field1 IN (83944, 83955, 83954, 83951,83947, 83946, 83953)
ORDER BY CASE field1
WHEN 83944 THEN 1
...
September 26, 2013 at 6:58 pm
tbruce-3350 (9/26/2013)
lkent (9/26/2013)
Usually we only count days stay with a default of 1....
September 26, 2013 at 6:42 pm
Mauve (9/26/2013)
lkent (9/26/2013)
Usually we only count days stay with a default of 1....
September 26, 2013 at 6:40 pm
dastagiri16 (9/25/2013)
here i am not able to trust it is updated with 'A'
supose in cte last select statement can be changed to 'AA' it is not showing last updated record...
September 25, 2013 at 10:35 pm
Aadhar Joshi (9/25/2013)
Thank u all, I appreciate every one here for the solution.Finally, i found my own one.
Please share with us.
September 25, 2013 at 10:26 pm
I'll get into the spirit of this thing you've got going here!
CREATE TABLE #MyTable
(
city nchar(10)
);
INSERT INTO #MyTable VALUES ('A');
WITH SampleData (city) AS
(
SELECT...
September 25, 2013 at 6:53 pm
Briceston (9/25/2013)
Below is an example of my data using a create and insert.
--===== Create the test table with
Create table Admission
(Contract Varchar(4),
Admissiondate Varchar(6),
SumofCost...
September 25, 2013 at 6:29 pm
Why obfuscate such simple logic with a view?
SELECT CARDNO, [Date]=LEFT(b.strDate, 10)
,InTime=SUBSTRING(b.strDate, 12, 5)
,OutTime=SUBSTRING(c.strDate, 12, 5)
FROM table2 a
CROSS APPLY
(
SELECT...
September 25, 2013 at 12:10 am
My advice is plan for the worst and use a pattern split function like the one you'll find in the 4th link in my signature.
WITH SampleData (Name) AS
(
...
September 24, 2013 at 11:48 pm
Like this?
CASE WHEN C1 IS NULL THEN 'Alpha'
WHEN C1='' THEN 'Bravo'
WHEN C1='c' THEN 'Charlie'
ELSE 'Whiskey' END
September 24, 2013 at 11:36 pm
I don't think you've got enough information in this table to do this.
I'm not sure by your post whether you're looking to see an expanded hierarchy or simply the various...
September 24, 2013 at 8:40 pm
Viewing 15 posts - 1,411 through 1,425 (of 3,957 total)