Viewing 15 posts - 1 through 15 (of 3,478 total)
I started reformatting the code... here's my reformat (FWIW):
SELECT
sa.partid AS ALLOC_Part,
sa.quantity,
sa.ordertype,
sa.worksorderid,
sa.reference,
sa.stockvalue,
apm.partdesc,
soi.orderid,
soi.itemnumber,
soi.partid AS SOI_Part,
so.traderid,
t.[name],
u.[name] As SalesRep,
MAX(sub.Max_Batchvalue) AS High_Batchvalue
FROM stockallocations sa
INNER JOIN worksorders wo ON
sa.worksorderid = wo.id
INNER JOIN allpartmaster...
November 24, 2025 at 3:36 pm
The most obvious thing is that you're using INNER joins everywhere. If you want to keep all the records from one table, you need to OUTER join from that to...
November 24, 2025 at 12:21 am
What happened when you tried it?
with only 15 records, I'm not sure you'll see a huge difference, but give it a try and record both times. I didn't write this...
November 8, 2025 at 4:35 pm
Generally speaking, if you can provide a clear question, some sample data (create table and insert scripts), and an expected output, you can ask all kinds of questions and get...
October 23, 2025 at 11:52 pm
Since you're new here... here's an article you owe it to yourself to read (it'll take like 2 minutes!)
Forum Etiquette: How to post data/code on a forum to get...
October 22, 2025 at 1:41 am
force it to NTEXT?
[ @stmt = ] N'statement'
A Unicode string that contains a Transact-SQL statement or batch. @stmt must be either a Unicode constant or a Unicode variable. More complex Unicode expressions, such as...
September 29, 2025 at 8:56 pm
clone the report and have the TOP 15 filter on one and not on the other? Just have a hyperlink in each to go to the other report
September 27, 2025 at 5:58 pm
Are you using your login credentials to run the SSIS packages? I think you need to use different accounts, otherwise, there's no way to tell the two apart.
September 21, 2025 at 4:51 am
It already "knows"... That's what SYSTEM_USER returns. For example...
SELECT SYSTEM_USER AS WindowsAccount, be.*
FROM Bakery.dbo.BakeEvents be;
I know, looks really stupid, but the first column is the user running...
September 20, 2025 at 8:28 pm
I can calculate the new unit cost or value or whatever... But do I store it in something like a stockTake table? Something like this?
CREATE TABLE [dbo].[StockTake](
[StockTakeID]...
September 13, 2025 at 2:37 am
In other words, a running total of Open + Created + Won + Lost
You could calculate them individually and then add... or...
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW?? (using a...
September 12, 2025 at 8:50 pm
Don't you optimize workloads and not individual queries? Some queries may get slower if you change indexing, but on the whole, the workload efficiency will increase. I doubt that's something...
September 11, 2025 at 6:43 pm
Oh, sorry. Silly me! So I just modify the step where it writes the one row ...
' Display last table's content.
...
July 24, 2025 at 6:48 pm
Why would I need enterprise grade for a one man show? For something he'd run every few weeks? I'm not processing 100K files an hour.
If you can point out where...
July 24, 2025 at 3:38 am
FWIW, I got one way to work... I used Abscess and Excel and a linked table to SQL Server. That way I can just call .RefreshAll() in Excel so that...
July 22, 2025 at 7:20 pm
Viewing 15 posts - 1 through 15 (of 3,478 total)