Viewing 15 posts - 61 through 75 (of 926 total)
You required comma separated values in single column. Following is a code which demonstrate it:
Declare @Table table
(
ID int,
Code varchar(10),
score int
)
insert into @Table
select 1,'aa',44 union all
select 1,'bb',54 union all
select 1,'cc',74 union...
September 28, 2016 at 7:02 am
Congrats. Thanks for your feedback.
August 24, 2016 at 6:08 am
richardmgreen1 (8/23/2016)
August 23, 2016 at 5:03 am
richardmgreen1 (8/23/2016)
I've stepped through the code as it is and, in the watch window, the times are the correct format in both cases.
It appears to be only when the...
August 23, 2016 at 4:22 am
Jeff Moden (8/22/2016)
While Now.ToString("hh:mm:ss tt") < dtStopTime.ToString("hh':'mm':'ss tt")
... because the single...
August 23, 2016 at 4:11 am
Many thanks for clearing my doubt with related examples. These type of things can only be learned either by hands on experience or by asking experienced forum users. Sadly I'am...
August 18, 2016 at 12:23 am
Yep that's pretty much what Dixie figured out, and you finished it off nicely. Nice job. I'd still go for avoiding the REPLACE. I don't think they are necessary, in...
August 16, 2016 at 6:34 am
ChrisM@Work, +1.
But if you still interested to use your own code then you just need to convert the NVARCHAR(MAX) when assigning it to @SQL4. Here is the updated query:
-- Query...
August 16, 2016 at 4:00 am
Ombir (8/15/2016)
The Select statement in the APPLY clause doesn't include a FROM clause because it's referencing a column from previous tables (in this case DtlChrg) and making computations on the...
August 16, 2016 at 1:13 am
Apply Operator is to make the query less complex, rather then to make it more complex.
For Example:
If you would have required to have a aggregation on the vChargeCode...
August 16, 2016 at 12:49 am
I'm learning T-Sql and having hard time to understand how this query works. Every time I see the apply operator in forums, its being applied with different logic.
Well, If you...
August 15, 2016 at 1:42 am
I tweaked your query thus to generate the tally on the fly and to change the column names to fit in with my test harness:with N10(n) AS (
SELECT CAST(n AS...
August 12, 2016 at 4:32 am
The Dixie Flatline (8/11/2016)
;with Eomonths (Eom) as (select top(500) EoMonth(DateAdd(MONTH,(N-1),'1/1/2016')) from tally)
select Eom as Check_date, Total
from...
August 11, 2016 at 11:41 pm
Did you test it with datetime?
Yes i did.
August 11, 2016 at 5:06 am
Just a minor adjustment to Chris solution, It will not handle if there is date and time are coming in the check_date column.
Here is Chris updated script:
SELECT
t.[Check_date],
cnt = COUNT(*)
FROM...
August 11, 2016 at 4:34 am
Viewing 15 posts - 61 through 75 (of 926 total)