I have created a query based on one database but I need to select a database depending on user input from a directory as each month a new database will be created
i want the query to run on all database with similar name and there will be newer databases created every month
my sql query is:
SELECT SLS1220.BILL_NO, SLS1220.SESSION_NO, SLS1220.WAITER, SLS1220.PAY_TYPE, SLS1220.BILL_DATE, SLS1220.BILL_TIME, SLS1220.TOTAL, SLS1220.TAXES, SLS1220.AUTO_GRAT, SLS1220.DISCOUNT, SLS1220.RECEIVED, SLS1220.REV_CENTER
FROM SLS1220
WHERE (((SLS1220.BILL_NO)>=Nz([StartNo],0) And (SLS1220.BILL_NO)<=nz([EndNumber],100000000)) AND ((SLS1220.BILL_DATE)>=Nz([Enter Start Date],"01/01/1900") And (SLS1220.BILL_DATE)<=nz([End Date],"31/12/9999")) AND ((SLS1220.RECEIVED)>=Nz([Start Amount],0) And (SLS1220.RECEIVED)<=nz([End Amount],999999999)));
The SLS1220 next month will be SLS0121 and so on