Viewing 15 posts - 346 through 360 (of 1,396 total)
It seems there are 3 compound conditions: 1) where (drive=c and percentage free<10), or 2) where (drive!=c and percentage free<20), and 3) where not (server=vc5 and drive in (...)). Maybe...
August 18, 2022 at 11:49 am
Also add PARTITION BY ID to the SELECT INTO
SELECT *,
LAG(ReportDate) OVER (partition by id ORDER BY ReportDate) LagReportDate,
...
August 5, 2022 at 9:22 pm
Can you provide more detail on what you mean when you say 'add the LAG columns to #MyData'?
/* Add LAG function columns to the query which...
August 5, 2022 at 7:37 pm
If you add the LAG columns to #MyData you could try CROSS JOIN'ing the calendar rows with the distinct IDs. Then LEFT JOIN #MyData on id and date.
August 5, 2022 at 6:37 pm
The behavior is called "late binding" and for many workflows and from many points of view it's a feature and not a flaw. Early binding is available in SQL Server...
August 5, 2022 at 6:15 pm
The Dark Mode issue is real. Iirc MS's excuse (for years and years) for not having it has been it would potentially make SSMS unstable. Disappointing. Largely due to the...
August 5, 2022 at 12:05 pm
Maybe you could add the LAG columns to #MyData. Then use a combination of LAG and MAX OVER. If this were SQL Server 2022 you could use the WINDOW clause
August 4, 2022 at 11:34 pm
The variable @ObjectName provided as an example was not plural such that it corresponds to an actual system object. Try it with N'sys.objects' instead of N'sys.object'. YOU NEED TO PROVIDE...
August 4, 2022 at 12:57 pm
If it's the code in your picture which produced the error message then your probable issue imo is a type mismatch between the join columns. Either ar.S1WHS# or wf.L3WHS# is...
August 4, 2022 at 1:28 am
You could try using TRY_CAST to determine which row values are causing the CAST to fail
select *
from YourTable
where TRY_CAST(MASTER_BOL_NUMBER as numeric) is null;
August 4, 2022 at 12:18 am
What about making datatype specific fnTally-ies? Many times the maximum requirement is less than BIGINT. What about fnTallySmalldatetime, fnTallyDatetime? What about making separate 0+ version and 1+ versions?
Any editorial regarding...
July 31, 2022 at 2:02 pm
It's only 2 rows of data. To test with different cases I added some additional rows. Afaik you're looking to conditionally apply the sum of invoiceid credits from 'creditmemo' to...
July 31, 2022 at 11:33 am
It seems you're looking for the COALESCE function. If the empty values are stored as '' then NULLIF returns NULL. COALESCE returns the first (left to right of the parameter...
July 22, 2022 at 10:03 pm
There are a number of issues with the code provided imo. Minor issues are DISTINCT is not necessary when used in conjunction with GROUP BY and inconsistent or absent table...
July 21, 2022 at 12:26 pm
Viewing 15 posts - 346 through 360 (of 1,396 total)