[HELP] Covert Col to Row & Del Row where x is empty

harky

Active Member
Joined
Apr 8, 2010
Messages
405
Office Version
  1. 2021
  2. 2019
Platform
  1. Windows
After key in the Code, it become like this
BS_CodeContractIDInstall BS Per DayLayoutIDQty
11112019100228WP1
11112019100705WP


I want to delete the row if [qty] col is empty.


Result should be this
BS_CodeContractIDInstall BS Per DayLayoutIDQty
11112019100228WP1


VBA Code:
SELECT TbInvoice2.BS_Code, TbInvoice2.ContractID, TbInvoice2.[Install BS Per Day], '228WP' AS LayoutID, [228WP] AS Qty
FROM TbInvoice2 where null is null;
union all
SELECT TbInvoice2.BS_Code, TbInvoice2.ContractID, TbInvoice2.[Install BS Per Day], '705WP' AS LayoutID, [705WP] AS Qty
FROM TbInvoice2 where [705WP] is null;
 
sorry i dont know SQL so tht was testing..

the fact is base on QTY.
If qty is empty, the whole row del, tht what u see on the result

SELECT TbInvoice2.BS_Code, TbInvoice2.ContractID, TbInvoice2.[Install BS Per Day], '705WP' AS LayoutID, [705WP] AS Qty
FROM TbInvoice2 where [QTY] is null;
None the wiser :(

If you just want to delete rows where qty is Null, just use that as criteris in a Delete query.?

Delete query syntax
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,214,870
Messages
6,122,019
Members
449,060
Latest member
LinusJE

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top