Viewing 15 posts - 1 through 15 (of 69 total)
You can use a CTE that first sums up the data according to the date, and then run the query on the CTE:
create table main3( saleddate date,...
March 21, 2022 at 1:30 pm
you can use the sum function with over clause. Here is an example that is based on your script:
--create thet table
create table main3( saleddate date, sales_count int)
go
--insert...
March 21, 2022 at 12:30 pm
Unfortunately I believe that most places don't even bother to go over our time tracking reports. Few years ago my brother worked in a big company and made a bet...
December 23, 2021 at 8:43 am
SSMS shows you the matching parenthesis when your cursor is on the matching parenthesis. Some times it is hard to see it, so you can configure it to use a...
December 1, 2021 at 3:17 pm
Why are you storing date as numeric data type? You should store it as what it is and compare it to the same data type instead of a numeric data...
November 30, 2021 at 12:58 pm
If I understand what you wrote, you already get the wrong data in the CSV file. If this is so, then all the modification that you'll do for the import...
November 17, 2021 at 8:47 am
From my experience almost all times that I had databases that were stuck on recovery pending, someone messed up with the storage and SQL Server was not able to find...
October 25, 2021 at 2:06 pm
Format function does not change the calculation. It takes the results of the calculation and then modify the format. In your case all the columns in you expression are integer,...
September 29, 2021 at 7:20 am
Could also check logon trigger.
Adi
September 19, 2021 at 11:36 am
I'm sorry, but I think that I'm misunderstanding something. In your results you updated the record that has replacementCode 860, but according to my understanding from your explanation, it should...
September 19, 2021 at 6:06 am
Are you running the select * statement from the same process that locks the records? If so, the select * statement should return all the records from the table, because...
September 12, 2021 at 6:19 am
Here is one way that does it:
declare @t table (name varchar(50))
insert into @t (name) values
('ARANESP 100MCG PFS SOLD BY THE'),
('ARANESP 200MCG PFS SOLD BY THE'),
('ARANESP 40MCG...
August 19, 2021 at 2:59 pm
select iif(len(first_name) > 10, concat(SUBSTRING(first_name, 1, 10),'...'),SUBSTRING(first_name, 1, 10)) as first_name from @t1
Adi
August 19, 2021 at 7:28 am
I think that this update should do it:
update #test
set AmountAll = Amount * NumDays
where NumDays > 0
go
Adi
August 18, 2021 at 7:52 am
The ring buffer stores the information only in memory and does not store it also in a file. There are some problems with ring buffer. The first problem is that...
August 17, 2021 at 7:51 am
Viewing 15 posts - 1 through 15 (of 69 total)