June 27, 2023 at 3:14 am
Jonathan I may need to check again, but I think it works. Thank you!! I really appreciate your help.
June 27, 2023 at 6:35 am
@Phil Parkin, simply a query which removes them from the rows that are selected.
I don't have any CREATE statements. I am just selecting rows from CTE.
You have >600 points, so I assume that you've been asked to do this before? Not providing consumable DDL and sample data has, in this case, resulted in a longish thread which would otherwise have been resolved far sooner. Surely you can see that?
Just to be clear, so that you don't use the same excuse in future, you can easily make up CREATE and INSERT statements based on your posted image.
DROP TABLE IF EXISTS #final_output;
CREATE TABLE #final_output(FreightBillId INT, VoucherNum VARCHAR(20), blah blah)
INSERT #final_output
(
FreightBillId
,VoucherNum
, ...
)
VALUES
()
Had you done this and posted your desired output, this thread would have been closed far sooner.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
July 7, 2023 at 7:16 am
You have multiple problems with your approach:
First, you NEVER delete General Ledger entries! You can offset them to change the total but NEVER delete them. That being said who in your accounting department told you that you can ? They should be dismissed immediately.
Second, if you're doing this for a report then Select the data you want into a temporary table and then manipulate that table by deleting the rows that you don't want to see and return what's left of the table from your stored proc.
Just the ramblings of an old man.
July 11, 2023 at 8:59 am
This was removed by the editor as SPAM
July 13, 2023 at 10:34 am
This was removed by the editor as SPAM
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply