Ok, is attached files. To test, hold the 2 files in the same folder Regards,
Basole. 2014-08-29 11:58 GMT-03:00 Eugene Bernard <eugene.bern...@gmail.com>: > Basole, > > Thanks for your solution. > > Can you please send me the working example along with excel file with > sample data. > > I tried your code with my data, and i am getting an error message. > > Regards > Eugene > > > On Saturday, August 23, 2014 7:04:59 PM UTC+5:30, Basole wrote: > >> Hi, >> >> See this example extracts the data from your file T2308.xls (T & date: >> and change the name according to the current(or system date)), using ADO >> and SQL statement. >> >> regards. >> >> >> Basole >> >> >> >> 2014-08-23 8:55 GMT-03:00 Eugene Bernard <eugene....@gmail.com>: >> >>> Dear all, >>> >>> I am daily using the attached sample query file to extract data from an >>> excel file stored in my windows desktop. >>> >>> I am pasting below a part of code from the test.dqy file, where I am >>> daily changing the file name based on the date on which it is being run. >>> >>> Instead of changing it manually, is there any possibility to change it >>> based on the system date. >>> >>> ie T2408 in place of T2308 if I run the query on 23/08/2014. >>> >>> SELECT `Sheet1$`.Date, `Sheet1$`.DptNo, `Sheet1$`.Empno, `Sheet1$`.Leave >>> FROM `C:\Users\jeb501\Desktop\T2308.xls`.`Sheet1$` `Sheet1$` WHERE >>> (`Sheet1$`.DptNo='01') >>> Note : I am using EXCEL 2007 >>> >>> TIA >>> >>> Eugene >>> >>> -- >>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? >>> It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ >>> https://www.facebook.com/discussexcel >>> >>> FORUM RULES >>> >>> 1) Use concise, accurate thread titles. Poor thread titles, like Please >>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice >>> will not get quick attention or may not be answered. >>> 2) Don't post a question in the thread of another member. >>> 3) Don't post questions regarding breaking or bypassing any security >>> measure. >>> 4) Acknowledge the responses you receive, good or bad. >>> 5) Jobs posting is not allowed. >>> 6) Sharing copyrighted material and their links is not allowed. >>> >>> NOTE : Don't ever post confidential data in a workbook. Forum owners >>> and members are not responsible for any loss. >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "MS EXCEL AND VBA MACROS" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to excel-macros...@googlegroups.com. >>> To post to this group, send email to excel-...@googlegroups.com. >>> >>> Visit this group at http://groups.google.com/group/excel-macros. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s > =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > 2) Don't post a question in the thread of another member. > 3) Don't post questions regarding breaking or bypassing any security > measure. > 4) Acknowledge the responses you receive, good or bad. > 5) Jobs posting is not allowed. > 6) Sharing copyrighted material and their links is not allowed. > > NOTE : Don't ever post confidential data in a workbook. Forum owners and > members are not responsible for any loss. > --- > You received this message because you are subscribed to the Google Groups > "MS EXCEL AND VBA MACROS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to excel-macros+unsubscr...@googlegroups.com. > To post to this group, send email to excel-macros@googlegroups.com. > Visit this group at http://groups.google.com/group/excel-macros. > For more options, visit https://groups.google.com/d/optout. > -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.
GetTdateExample.xlsm
Description: application/vnd.ms-excel.sheet.macroenabled.12
T2908.xls
Description: MS-Excel spreadsheet