[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;
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Your data is not structured correcly, so this is why you have this problem.?
Are there more xxSWP fields.?

You could just run a delete query for each xxSWP that is Null?
 
Upvote 0
actually i want to transpose from query (Covert Col to Row)from other table.
This is already a query, i just want to query with 2 statement?

Your data is not structured correcly, so this is why you have this problem.?
Are there more xxSWP fields.?

You could just run a delete query for each xxSWP that is Null?
Your data is not structured correcly, so this is why you have this problem.?
Are there more xxSWP fields.?

You could just run a delete query for each xxSWP that is Null?
 
Upvote 0
So wjy not just bring in records that are not Null for xxSWP?
 
Upvote 0
Well it is not qty is it?, it is 70SWP ?

The same applies to any other xxSWP field?
 
Upvote 0
I must confess, I an completely confused? :(

You have SQL as
Code:
SELECT TbInvoice2.BS_Code, TbInvoice2.ContractID, TbInvoice2.[Install BS Per Day], '705WP' AS LayoutID, [705WP] AS Qty
FROM TbInvoice2 where [705WP] is null;

which is always going to produce an empty quantity and then you want to delete it.?
 
Upvote 0
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;


I must confess, I an completely confused? :(

You have SQL as
Code:
SELECT TbInvoice2.BS_Code, TbInvoice2.ContractID, TbInvoice2.[Install BS Per Day], '705WP' AS LayoutID, [705WP] AS Qty
FROM TbInvoice2 where [705WP] is null;

which is always going to produce an empty quantity and then you want to delete it.?
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,255
Members
449,075
Latest member
staticfluids

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