View Single Post
  #24  
Old June 23rd, 2009, 12:46 AM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default getting a report from a crosstab query

"Instead of seeing D6, D5, D4, I need to see The actual dates." I want you
to see the actual dates in your report also. Everything I have posted
supports this. All recent posts have referenced your form and your report.
These posts as well as the FAQ link I posted support this.

Can you tell me what you have done to follow through on my suggestions
within your report. Don't tell me anything about your query since the correct
values are displaying in your query. We are now concerned only about the
report and how it pulls values from your OPEN form.

--
Duane Hookom
Microsoft Access MVP


"abourg8646 via AccessMonster.com" wrote:

when I started then my crosstab quert displayed the dates in the column
header. ex.

NAME: Post: Time: Shift 5/2/2007 5/3/2007 5/4/2007 5/5/2007 ....
John ACC 0600 1st 0600 0600 OFF VAC

But it would let me create a report. The SQL was as follows:
PARAMETERS [Start date] DateTime, [End Date] DateTime;
TRANSFORM First([Employee Query].Schedule) AS FirstOfSchedule
SELECT [Employee Name], Shift, Post, [Time]
FROM [Employee Query]
WHERE [Date] Between [Start Date] And [End Date]
GROUP BY [Employee Name], Shift, Post, [Time]
PIVOT [Employee Query].[Date];

The we changed the SQL to
PARAMETERS Forms!frmDate!txtEndDate DateTime;
TRANSFORM First([Employee Query].Schedule) AS FirstOfSchedule
SELECT [Employee Name], Shift, Post, [Time]
FROM [Employee Query]
GROUP BY [Employee Name], Shift, Post, [Time]
PIVOT "D" & DateDiff("d",[Date],Forms!frmDate!txtEndDate)
IN ("D6","D5","D4","D3","D2","D1","D0") ;

This worked good but it didn't show the date it looked like this:
NAME: Post: Time: Shift D6 D5 D4 D3 ....
John ACC 0600 1st 0600 0600 OFF VAC ....

Instead of seeing D6, D5, D4, I need to see The actual dates.


Duane Hookom wrote:
If you want to reference the value of a control from a form, the form must be
open and contain a value in the control.

You might want to check out Crystal's tutorials at
http://www.youtube.com/user/LearnAccessByCrystal.

I placed 7 text boxes in the page header and used the staement that you
supplied. I'm still getting the same response #Name?. The form isn't open

[quoted text clipped - 23 lines]
GROUP BY [Employee Name], Shift, Post, [Time]
PIVOT [Employee Query].[Date];


--
Arthur Bourgeois Jr

Message posted via http://www.accessmonster.com