Viewing 15 posts - 511 through 525 (of 3,489 total)
Why not go crazy and use a WHERE clause to find the records that are different and only update those?
July 21, 2021 at 2:12 pm
SELECT DATEDIFF(day, [ExpiredDate], GETDATE() )
FROM MyTable
July 19, 2021 at 9:14 pm
use tempdb;
go
SELECT x.ExpiredDate
, isfuture = iif(x.ExpiredDate>getdate(),'future','past')
, daysAgo = DATEDIFF(day, getdate(),x.ExpiredDate)
, PassTest = IIF(DATEDIFF(day, getdate(),x.ExpiredDate) = x.ExpectedDaysAgo,1,0)
FROM (VALUES
('2021-07-25 15:29:09.000', 6)
,('2021-07-28 17:31:22.000', 9)
,('2021-07-19 04:02:54.000', 0)
,('2021-07-18 12:01:31.000', -1)
)...
July 19, 2021 at 8:13 pm
A big part of your problem is that you data is pivoted, and you need to unpivot it to store it. Unpivoting something like this using PowerQuery is child's play. Basically,...
July 8, 2021 at 4:12 am
That will work. The basic idea is that you have to have the first query execute, and then the second work on the first... and that's essentially what a CTE...
July 6, 2021 at 9:15 pm
Sorry, some days I'm dumber than a freaking rock. I think your problem is that FundVariance doesn't have a value when you're trying to filter it. It's evaluated after the...
July 3, 2021 at 3:51 am
Why not create a fiscal calendar? It's a whole one record per day. They're super helpful if you're doing stuff like sales analysis. Then this is ridiculous easy.
July 3, 2021 at 3:49 am
Put all your queries and stored procedures as close to the data (back end) as you can. Especially if it's in Azure.
I think I can put multiple Access append queries...
June 25, 2021 at 2:57 am
You've got that many points and you can't post create table and insert scripts? =(
Anyway, do everyone a favor and post them so they don't have to waste their time...
June 24, 2021 at 11:15 pm
use a WHERE clause or a join in your UPDATE statement so the records you don't want updated don't get updated?
June 24, 2021 at 10:49 pm
Why not? You could add filter parameters etc.
CREATE PROCEDURE MyProc
@param1 VARCHAR(10),
...
June 22, 2021 at 6:02 pm
Create a measure for Total Sales, and another measure for Total Transactions, and then a third where you subtract the two. (I like building simple measures and then combining them...
June 21, 2021 at 9:40 pm
Aren't checkbox values either 1 0r 0?
June 17, 2021 at 3:26 am
Once this is converted to a time, this should be easy... get a MAX of the time, and then subtract 30 mins, so something like [theTime]>=(SELECT DATEADD(minute,-30,MAX(Time))
June 16, 2021 at 12:04 am
(Is it a good idea to record the size of the various tables you want to track by inserting the recordcounts for each into a static table?)
I've done this by...
June 15, 2021 at 12:19 am
Viewing 15 posts - 511 through 525 (of 3,489 total)