Viewing 15 posts - 31 through 45 (of 179 total)
String Concat missing, ur trying to concat a string and an integer
DECLARE @frdate date = '01-01-2021'DECLARE
@ytdfrDate date
if Month(@frDate) < 4begin
SET @ytdfrDate = '01/04/' + cast(dateadd(y,-1,@frdate) as...
August 17, 2021 at 7:46 am
Im curious how to solve this properly, the first step might be checking for gaps with the LAG function, but all after that i can think off on the fly...
August 17, 2021 at 4:51 am
For future posts, please provide a simple temp table code example like mine, saves the others doing the same thing every time
I left out some columns which are not relevant...
August 12, 2021 at 1:04 pm
I think Google has some type of API that does address correcting.
I'd look for that or some other known app to do this. What you're trying to do is...
August 12, 2021 at 4:11 am
Every column thats used in select but not an aggregation (avg/sum/...) needs to be in the group by after the from:
group by [candidateref],
...
August 10, 2021 at 1:05 pm
Depends on what ur looking for, are you looking for a count or a distinct count (counting each ref only once, ignoring duplicates)
Maybe something like this case when helps
August 10, 2021 at 11:18 am
Does it have to be a query using variables etc?
In theory you can get the first of each month and then do a group by with your distinct count of...
August 10, 2021 at 8:42 am
For future posts, please post some example code:
August 6, 2021 at 6:35 am
Intresting
I always feel like im not using so much of the available stuff that SQL Server offers.
Most of the stuff i discover is from reading forum replies here.
August 6, 2021 at 6:28 am
Maybe someone else understood what you want, i myself am totally lost at what ur problem is or even what ur trying to achieve.
Always provide sample code, because text descriptions...
August 2, 2021 at 1:11 pm
This should do the trick:
Identify the columns you want to group by --> ID_Order, ID_Product from either table
Identify the columns you want to aggregate --> IN.Amount, Out.Amount
Identify the columns you...
July 15, 2021 at 4:17 am
Something like this?
Creating the 2 Tables
select CDMLOCID = '201', CDMPOLL = cast('2021-06-20 00:00:00.000' as datetime2), JOBCODE = '10', DATETIMEIN = cast('2021-06-20 10:32:00.000' as datetime2), DATETIMEOUT = cast('2021-06-20...
June 24, 2021 at 4:44 am
What is the source data for this? Where do these variables come from? What will the 'dynamic string' be used for, once it has...
April 28, 2021 at 10:09 am
What is the source data for this? Where do these variables come from? What will the 'dynamic string' be used for, once it has been created?
I am experimenting...
April 28, 2021 at 8:51 am
That does not look feasible to me.
It would be helpful if you could explain the background and reasons for trying to do this – there may be some...
April 28, 2021 at 8:44 am
Viewing 15 posts - 31 through 45 (of 179 total)