Writing sql for a table to extract information for reporting

shah0101

Board Regular
Joined
Jul 4, 2019
Messages
139
HELLO EXPERTS,

I NEED TO WRITE A SIMPLE SQL TO EXTRACT DATA FROM A TABLE. TABLE IS ALREADY EXTRACTING DATA FROM MULTIPLE FILES AND IS REFRESHING WELL WHEN DATA IS UPDATED IN SOURCE FILES.

NOW FROM THIS TABLE I NEED TO WRITE COUPLE OF COMMANDS / SQL IN DIFFERENT SHEETS / WORKBOOKS WHICH MAY USE SOME KIND OF "REFRESH" OPTION WHEN NEEDED.

[TABLE="width: 4420"]
<tbody>[TR]
[TD="width: 223"]Source.Name[/TD]
[TD="width: 127"]INVOICE NO.[/TD]
[TD="class: xl63, width: 93"]BL DATE[/TD]
[TD="width: 236"]P.I. NO.[/TD]
[TD="width: 89"]OFFICE[/TD]
[TD="width: 270"]BUYER[/TD]
[TD="width: 82"]CARTONS[/TD]
[TD="width: 88"]QUANTITY[/TD]
[TD="width: 110"]GROSS VALUE[/TD]
[TD="width: 88"]DEPOSITS[/TD]
[TD="width: 91"]NET VALUE[/TD]
[TD="width: 65"]TENOR[/TD]
[TD="class: xl63, width: 100"]DUE DATE[/TD]
[TD="width: 219"]LC NO.[/TD]
[TD="width: 568"]DESCRIPTION[/TD]
[TD="width: 181"]SUPPLIER[/TD]
[TD="width: 343"]SUPPLIER INV. NO.[/TD]
[TD="width: 451"]IMPORT AMOUNT[/TD]
[TD="width: 225"]VESSEL NAME[/TD]
[TD="width: 203"]LOADING[/TD]
[TD="width: 568"]DESTINATION[/TD]
[/TR]
</tbody>[/TABLE]


THIS IS THE HEADER AND FOR AN EXAMPLE I NEED TO TO MAKE A REPORT WHICH MAY BRING:

INVOICE NO.
BL DATE
P.I. NO.
BUYER
GROSS VALUE
DEPOSITS
NET VALUE

THAT MATCHES THE "BUYER" = "XYZ COMPANY" AND AUTOMATICALLY ADDING A TOTAL FOR:

GROSS VALUE
DEPOSITS
NET VALUE

NOW FROM ORIGINAL TABLE IF IT GET "REFRESHED" THE REPORT MAY ALSO HAVE AN OPTION TO "REFRESH" APPENDING NEW ENTRIES (IF ANY).

PLEASE GUIDE / ADVISE.

THANKS IN ADVANCE.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
hello experts,

i need to write a simple sql to extract data from a table. Table is already extracting data from multiple files and is refreshing well when data is updated in source files.

Now from this table i need to write couple of commands / sql in different sheets / workbooks which may use some kind of "refresh" option when needed.

[table="width: 4420"]
<tbody>[tr]
[td="width: 223"]source.name[/td]
[td="width: 127"]invoice no.[/td]
[td="class: Xl63, width: 93"]bl date[/td]
[td="width: 236"]p.i. No.[/td]
[td="width: 89"]office[/td]
[td="width: 270"]buyer[/td]
[td="width: 82"]cartons[/td]
[td="width: 88"]quantity[/td]
[td="width: 110"]gross value[/td]
[td="width: 88"]deposits[/td]
[td="width: 91"]net value[/td]
[td="width: 65"]tenor[/td]
[td="class: Xl63, width: 100"]due date[/td]
[td="width: 219"]lc no.[/td]
[td="width: 568"]description[/td]
[td="width: 181"]supplier[/td]
[td="width: 343"]supplier inv. No.[/td]
[td="width: 451"]import amount[/td]
[td="width: 225"]vessel name[/td]
[td="width: 203"]loading[/td]
[td="width: 568"]destination[/td]
[/tr]
</tbody>[/table]


this is the header and for an example i need to to make a report which may bring:

Invoice no.
Bl date
p.i. No.
Buyer
gross value
deposits
net value

that matches the "buyer" = "xyz company" and automatically adding a total for:

Gross value
deposits
net value

now from original table if it get "refreshed" the report may also have an option to "refresh" appending new entries (if any).

Please guide / advise.

Thanks in advance.









can a vba code help me on that?


Any one?
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,212
Members
452,618
Latest member
Tam84

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