Jumat, 21 April 2017

Re: [MS_AccessPros] How to Declare Field Variables in SQL?

 

Ah, yes. A Crosstab query is the one case where you must always declare parameters. Add a Parameters statement, and you should be all set. 

John Viescas, author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Office Access 2010 Inside Out 
Microsoft Office Access 2007 Inside Out 

On Apr 21, 2017, at 10:38 PM, xenon.blue@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Hi John,

This is the SQL statement that works the query and produces a data set with no problems. For some reason the Chart SQL in the report can't recognize the input fields from the form. 

Query SQL Statement:

SELECT tblCell_Data.Cell, tblCell_Data.Date, tblCell_Data.WO_Forecast, tblCell_Data.WO_Complete, [WO_Complete]/[WO_Forecast] AS Percent_Complete, tblCell_Data.COMMENTS
FROM tblCell_Data
WHERE (((tblCell_Data.Date) Between [Forms]![frmQueryByDate]![L_Date] And [Forms]![frmQueryByDate]![U_Date]));


Chart SQL statement:

TRANSFORM Avg(qryCalculations_Paint.[Avg Of Percent_Complete]) AS [AvgOfAvg Of Percent_Complete]
SELECT qryCalculations_Paint.Cell
FROM qryCalculations_Paint
GROUP BY qryCalculations_Paint.Cell
PIVOT qryCalculations_Paint.Week;


Greg

__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar