Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / May 2008

Tip: Looking for answers? Try searching our database.

Cross Tab Query and a Date Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
T Kelley - 28 May 2008 14:04 GMT
I use Date Forms a lot to pass dates through to queries, but for some reason
I can't do the same for Cross Tab Queries. Any ideas?
KARL DEWEY - 28 May 2008 15:43 GMT
You have to declare parameters in a crosstab query.
OPen the query in design view, click on menu QUERY - Parameters.  Enter the
parameter and type - it must be typed exactly the same - suggest copying and
pasting to eliminate errors.
Signature

KARL DEWEY
Build a little - Test a little

> I use Date Forms a lot to pass dates through to queries, but for some reason
> I can't do the same for Cross Tab Queries. Any ideas?
T Kelley - 28 May 2008 15:52 GMT
I have never used that before, can you elaborate a bit more on what should go
in the Parameter Field? I am guessing the Data Type is a Date/Time.

> You have to declare parameters in a crosstab query.
> OPen the query in design view, click on menu QUERY - Parameters.  Enter the
[quoted text clipped - 3 lines]
> > I use Date Forms a lot to pass dates through to queries, but for some reason
> > I can't do the same for Cross Tab Queries. Any ideas?
KARL DEWEY - 28 May 2008 17:29 GMT
Copy the parameter/criteria from your query such as --
  [Forms]![MyDateForm]![Start_Date]
Signature

KARL DEWEY
Build a little - Test a little

> I have never used that before, can you elaborate a bit more on what should go
> in the Parameter Field? I am guessing the Data Type is a Date/Time.
[quoted text clipped - 6 lines]
> > > I use Date Forms a lot to pass dates through to queries, but for some reason
> > > I can't do the same for Cross Tab Queries. Any ideas?
T Kelley - 29 May 2008 13:06 GMT
Perfect! Thank You!

> Copy the parameter/criteria from your query such as --
>    [Forms]![MyDateForm]![Start_Date]
[quoted text clipped - 9 lines]
> > > > I use Date Forms a lot to pass dates through to queries, but for some reason
> > > > I can't do the same for Cross Tab Queries. Any ideas?
T Kelley - 29 May 2008 13:22 GMT
Here is what i have now, i found an old access reference book. What if my
query spans across more than 1 year, how can i show the results

PARAMETERS [Forms]![F DATE FORM]![STARTDATE] DateTime, [Forms]![F DATE
FORM]![ENDDATE] DateTime;
TRANSFORM Count([T PAID TW VARIANCE DATA NEW].SC_ID) AS CountOfSC_ID
SELECT [T PAID TW VARIANCE DATA NEW].GROUP_ID
FROM [T PAID TW VARIANCE DATA NEW]
WHERE ((([T PAID TW VARIANCE DATA NEW].SC_DT) Between [Forms]![F DATE
FORM]![STARTDATE] And [Forms]![F DATE FORM]![ENDDATE]))
GROUP BY [T PAID TW VARIANCE DATA NEW].GROUP_ID
PIVOT Format([SC_DT],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");

What does the pivot line have to say to See Jan, Feb Mar etc 2007 than go to
2008.

My date range is 1/1/2007 thru 4/30/2008.

> Copy the parameter/criteria from your query such as --
>    [Forms]![MyDateForm]![Start_Date]
[quoted text clipped - 9 lines]
> > > > I use Date Forms a lot to pass dates through to queries, but for some reason
> > > > I can't do the same for Cross Tab Queries. Any ideas?
KARL DEWEY - 29 May 2008 17:28 GMT
Modify the query like this ---
.......
SELECT [T PAID TW VARIANCE DATA NEW].GROUP_ID, Format([SC_DT],"yyyy") AS
[Var Year]
......
GROUP BY [T PAID TW VARIANCE DATA NEW].GROUP_ID, Format([SC_DT],"yyyy") AS
[Var Year]
.......

    Or if you want the year then ID ---
.......
SELECTFormat([SC_DT],"yyyy") AS [Var Year],  [T PAID TW VARIANCE DATA
NEW].GROUP_ID
......
GROUP BY Format([SC_DT],"yyyy") AS [Var Year], [T PAID TW VARIANCE DATA
NEW].GROUP_ID
.......
Signature

KARL DEWEY
Build a little - Test a little

> Here is what i have now, i found an old access reference book. What if my
> query spans across more than 1 year, how can i show the results
[quoted text clipped - 28 lines]
> > > > > I use Date Forms a lot to pass dates through to queries, but for some reason
> > > > > I can't do the same for Cross Tab Queries. Any ideas?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.