Viewing 15 posts - 1,051 through 1,065 (of 1,390 total)
select
Cust_num, Co_num,
sum(amount) Total,
sum(iif(floor(datediff(d,due_date,getdate())/30)=0,amount,0)) [1-30 Days],
sum(iif(floor(datediff(d,due_date,getdate())/30)=1,amount,0)) [31-60 Days],
sum(iif(floor(datediff(d,due_date,getdate())/30)=2,amount,0)) [61-90 Days],
sum(iif(floor(datediff(d,due_date,getdate())/30)>2,amount,0)) [>90 Days]
from EES_App.dbo.artran_all
group by Cust_num, Co_num;
April 11, 2020 at 11:22 am
I think this is horrible advice. The customer number is an identifier for a customer (I assume), and not a magnitude or quantity of some attribute. Therefore, according to...
April 11, 2020 at 11:18 am
Something like this maybe
;with
SiteInfo(SiteId, SiteName, JobId, Grade) as (
select 1, 'aaa', 1, 'a'
union all
select 1,...
April 10, 2020 at 7:30 pm
To see more about what Jonathan's suggesting maybe have a look at this page:
It could be looked at like there're 2 ways to "include" columns in an index: 1) as...
April 10, 2020 at 3:04 pm
drop table if exists #tblRecorddetails;
go
create table #tblRecorddetails(
Recordid int,
Userid ...
April 9, 2020 at 3:29 pm
drop table if exists #temp;
go
create table #temp (
userid int , rid varchar(10), value varchar(100));
insert #temp(userid,rid,value) values
(1,'D01','3'),
(1,'D01','4'),
(2,'C01','hey'),
(2,'C01','1');
with t_cte(userid,rid,value) as (
select
...
April 8, 2020 at 11:36 pm
Maybe this could work too
select
coalesce(ph.username, (select Message from itrm_itbf.temp.security))
from
ITRM_ITBF.[PMD].[PMD_HR] ph
join
ITRM_ITBF.[Dflt].[MANUAL_LSV_PERMISSIONS] mlp on ph.username=mlp.username
...
April 8, 2020 at 4:36 pm
Instead of returning the SSN (which is being sent to the procedure already) could you return COUNT(*)? Count always returns a value.
April 8, 2020 at 4:21 pm
It's data obfuscation project, thus no strict rules what value should be, rather it should be random. Each row should have its own value. When we are out of...
April 6, 2020 at 7:45 pm
It randomly picks one of the words
;with data_cte(which_word) as (
select 'some' union all select 'word' union all select 'here')
select top(1)
which_word
from
...
April 6, 2020 at 6:13 pm
This is a beginning and it might get the OP past the id assignment issue.
drop table if exists #src_data;
go
create table #src_data(
EmpId ...
April 6, 2020 at 3:58 pm
Now while i was trying to implement merge, problem is how to assign new identifier value for new record (it should be max value +1 , and this column...
April 6, 2020 at 1:30 pm
Right there with you. I wouldn't bother on that other thread, though. That subject keeps cropping up over and over and over and some of the participants do too. ...
April 4, 2020 at 8:57 pm
Jeff are the results reversed? It lists FORMAT d14 method as 802ms. Maybe copy/paste gone off?
And, please... for the love of your servers and your customers, stop all the...
April 4, 2020 at 6:01 pm
@scdecade - your solution will not work for the OP. The trim function is not available on SQL Server 2016 and would need to be replaced with a rtrim(ltrim(...)). ...
April 4, 2020 at 5:39 pm
Viewing 15 posts - 1,051 through 1,065 (of 1,390 total)