Advertisement

06.09.2008 at 05:04AM PDT, ID: 23468705
[x]
Attachment Details

MS-ACCESS-2003 VBA:   Make-Table-Query:  How can I code the Query-SQL or a VBA Module to fill in....

Asked by Raj_B_700 in SQL Query Syntax, Visual Basic Programming, Access Coding/Macros

In MS Access 2003:

I need for the Make-Table-Query to every time it is run:  change the destination database name to fill-in/change to the current month-name at the very end of the db-name.  I also want the "end" date parameter to pick-up the "latest" pay-period-end-date by referencing a list that is a table within the same generation mdb.   The actual data will be pulling per the date specs from Sybase linked table that will be a make-table going to it's new destination - and will pull data YTD thru to the latest pay-period-end.

The person running this does not want any parameter boxes popping up.   There are other items that are run along with this in a Macro.  This 'open query' is one item in this Macro.    As soon as the query is opened,  I need for the query itself to reference the latest pay-period-end and fill it in - and - for it to reference the the month - and insert the month-name at the end of the destination-db-name.  Please see below.  

Can you please assist me with this?  It's really urgent........

The SQL Coding within the Make-Table Query is like this:

SELECT [_dbo_ncv_aud_allocs].* INTO [Output - Allocations] IN 'P:\Prod\Fy2008\AUD\RAJ_AUD_FY2008_MAY.mdb'
FROM _dbo_ncv_audit_val_allocs
WHERE ((([_dbo_ncv_aud_allocs].PPEndDate) Between [start] And [end]));

Thanking you for your time & help, sincerely, R.

Start Free Trial
[+][-]06.09.2008 at 05:35AM PDT, ID: 21742662

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, Visual Basic Programming, Access Coding/Macros
Sign Up Now!
Solution Provided By: peter57r
Participating Experts: 1
Solution Grade: B
 
 
[+][-]06.09.2008 at 06:03AM PDT, ID: 21742815

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.09.2008 at 08:54AM PDT, ID: 21744198

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628