Link to home
Start Free TrialLog in
Avatar of pgmtkl
pgmtkl

asked on

Access 2007 query export to excel template

Hi. I have an access query that is broken down by week 1 through 4 for a specific period. I have done access exports to multiple worksheets but what i would like to do with this is export the query to certain cells on the same worksheet depending on the date and week (1-4). The period doesnt follow the regular month. Is there a way to take one query with vba and export it based on a parameter? Or is the easiest way to create 4 queries and export to each cell? Any help is appreciated.
Avatar of Travis Hydzik
Travis Hydzik
Flag of Australia image

Please upload (a cutdown version) of the database and workbook.

The reference the tables/sheets and explain what you want to acheieve.
Avatar of pgmtkl
pgmtkl

ASKER

Attached is a copy of the query and template that i would like report to look like. 2 tables are being used.

SELECT FY12.ID, FY12.Date, FY12.Period, FY12.Week, FY12.Day, tbl_milestones.PJectID, tbl_milestones.PlannedDate, tbl_milestones.Status, IIf([Tbl_FY12.Day]="Sat","1",IIf([Tbl_FY12.Day]="Sun","2",IIf([Tbl_FY12.Day]="Mon","3",IIf([Tbl_FY12.Day]="Tue","4",IIf([Tbl_FY12.Day]="Wed","5",IIf([Tbl_FY12.Day]="Thu","6",IIf([Tbl_FY12.Day]="Fri","7","99"))))))) AS WkdaysortFROM tbl_milestones RIGHT JOIN FY12 ON tbl_milestones.[PlannedDate] = FY12.[Date];      
qrycal.xlsx
Project-Calendar-template.xlsx
ASKER CERTIFIED SOLUTION
Avatar of GRayL
GRayL
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
BTW you can test these functions as I did above by using the Immediate Pane - press Ctl+G
Thanks, glad to help.