Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sort of a long question, but worth a try. I have a dispatching spreadsheet
that copies electric outage events from a database to various service centers for dispatching. Let's say I run the report @ 0600 and more events come in after 0600. The report is already in place by service center and I just want to filter (by code) the more recent events and copy over to the last row of the existing report. (there are 14 service centers) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You haven't given very much details to get the best answer. We don't know
what your existing code looks like especially the query to the database. Sometimes it makes sense to just rerun the report. Other times it make sense to look at last line of the report for the time and then query the database of events occuring after this time. "HarveyM." wrote: Sort of a long question, but worth a try. I have a dispatching spreadsheet that copies electric outage events from a database to various service centers for dispatching. Let's say I run the report @ 0600 and more events come in after 0600. The report is already in place by service center and I just want to filter (by code) the more recent events and copy over to the last row of the existing report. (there are 14 service centers) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Joel, this is a daily report and usually runs at 0600. The code erases the
previous day report and querys by service center from the database. It then timestamps the query time on an update tab that shows the service center when the last query was made. Once the report is run, the supervisor has to finialize by requesting the type of crew needed for each event. If I rerun the report, this info wouldn't be correct..therefore....a new query would have to be added to the bottom of the last query and not contains duplicates from a previous time query. The code is a simple macro recording of a database filter, selecting each service center and then coping the info to a different tab marked for that service center. "Joel" wrote: You haven't given very much details to get the best answer. We don't know what your existing code looks like especially the query to the database. Sometimes it makes sense to just rerun the report. Other times it make sense to look at last line of the report for the time and then query the database of events occuring after this time. "HarveyM." wrote: Sort of a long question, but worth a try. I have a dispatching spreadsheet that copies electric outage events from a database to various service centers for dispatching. Let's say I run the report @ 0600 and more events come in after 0600. The report is already in place by service center and I just want to filter (by code) the more recent events and copy over to the last row of the existing report. (there are 14 service centers) |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It appears only two changes would be required to your present query.
1) The Desination line would have to be changed to place new data after the last data. from Destination := Range("A1") to LastRow = Range("A" & Rows.count).end(xlup).Row Destination := Range("A" & LastRow) + 1 2) The query would need some type of WHERE parameter added to select items after a certain time queryString = _ "SELECT * FROM product.dbf WHERE (product.ON_ORDER<0)" "HarveyM." wrote: Hi Joel, this is a daily report and usually runs at 0600. The code erases the previous day report and querys by service center from the database. It then timestamps the query time on an update tab that shows the service center when the last query was made. Once the report is run, the supervisor has to finialize by requesting the type of crew needed for each event. If I rerun the report, this info wouldn't be correct..therefore....a new query would have to be added to the bottom of the last query and not contains duplicates from a previous time query. The code is a simple macro recording of a database filter, selecting each service center and then coping the info to a different tab marked for that service center. "Joel" wrote: You haven't given very much details to get the best answer. We don't know what your existing code looks like especially the query to the database. Sometimes it makes sense to just rerun the report. Other times it make sense to look at last line of the report for the time and then query the database of events occuring after this time. "HarveyM." wrote: Sort of a long question, but worth a try. I have a dispatching spreadsheet that copies electric outage events from a database to various service centers for dispatching. Let's say I run the report @ 0600 and more events come in after 0600. The report is already in place by service center and I just want to filter (by code) the more recent events and copy over to the last row of the existing report. (there are 14 service centers) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
timevalue function | Excel Worksheet Functions | |||
TimeValue formula | Excel Worksheet Functions | |||
iserror(Timevalue()) | Excel Programming | |||
OnTime / TimeValue | Excel Programming | |||
Need Help with Code - TimeValue | Excel Programming |