Last Refresh Date per Query Excel

fdiddy

New Member
Joined
Nov 20, 2012
Messages
43
Hi All,
Looking for a solution to show Last Query Refresh Date for a specific query.

I have approx 6 Queries - each query i want to show (in that table once loaded) the last refresh date.

the data sources are a mix between SP & SQL

Thanks !
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Just an idea without using VBA. If you are willing to use one of the column headers to show the update time, then the following sample code might help.

Sample data - Table Name = "Table1"
1241493.xlsx
ABC
1field1field2field3
2Sample text 1 here47
3Sample text 2 here58
4Sample text 3 here69
Sheet1

Code:
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    LastRefresh = Table.RenameColumns(Source, {"field1", "Last Update: " & DateTime.ToText(DateTime.LocalNow(), [Format="dd MMM yyyy H:m"])})
in
    LastRefresh
Last Update: 19 Jul 2023 20:45field2field3
Sample text 1 here47
Sample text 2 here58
Sample text 3 here69


In fact, a little bit more creativity, you don't even have to remove the original header, but add the last update time in parentheses maybe?
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    FirstColumnHeader = Table.ColumnNames(Source){0},
    LastRefresh = Table.RenameColumns(Source, {FirstColumnHeader, FirstColumnHeader & DateTime.ToText(DateTime.LocalNow(), [Format=" (dd MMM yyyy H:m)"])})
in
    LastRefresh
field1 (19 Jul 2023 20:48)field2field3
Sample text 1 here47
Sample text 2 here58
Sample text 3 here69
 
Upvote 0

Forum statistics

Threads
1,223,327
Messages
6,171,486
Members
452,407
Latest member
Broken Calculator

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