Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy do I get "enter parameter value" only when using SELECT AS
    primarykey
    data
    text
    <p>This query</p> <pre><code>SELECT P2.ID, P2.Storenum, [Periods_2013-2014].[PeriodDate] AS [OpenFromDate], P2.[Open From Day], P2.[Open From Time], P2.[Open To Day], P2.[Open To Time] FROM [Periods_2013-2014] INNER JOIN [tblOpenCloseTimes] AS P2 ON [Periods_2013-2014].[Day]=P2.[Open From Day] WHERE ((([Periods_2013-2014].Day)=P2.[Open From Day] AND P2.Storenum ="43010605" AND [Periods_2013-2014].Period = "4")) </code></pre> <p>results in an "Enter Parameter Value" with <code>Query1.PeriodDate</code> as the requested parameter, whereas if I merely remove the "<code>AS [OpenFromDate]</code>" from the first line the query runs perfectly. It does the same if I alias the <code>[Periods_2013-2014]</code> table as P1. This wouldn't be a problem except that I need to stack the queries to get the <code>PeriodDate</code> field twice. What am I doing wrong? </p> <hr> <p>Update: This query</p> <pre><code>SELECT T2.Storenum, T2.[PeriodDate] AS [Open From Date], T2.[Open From Day], T2.[Open From Time], T1.[PeriodDate] AS [Open To Date], T2.[Open To Day], T2.[Open To Time] FROM [Periods_2013-2014] AS T1, (SELECT P2.Storenum, P1.[PeriodDate], P2.[Open From Day], P2.[Open From Time], P2.[Open To Day], P2.[Open To Time] FROM [Periods_2013-2014] AS P1 INNER JOIN tblOpenCloseTimes AS P2 ON P1.[Day]=P2.[Open From Day] WHERE (((P1.Day)=P2.[Open From Day] AND P2.Storenum ="43010605" AND P1.Period = "4")) ORDER BY P1.[PeriodDate]) AS T2 WHERE T1.[Day]=T2.[Open To Day] AND T1.[PeriodDate]&gt;=T2.[PeriodDate] AND T1.[PeriodDate] - T2.[PeriodDate] &lt;7 ORDER BY P1.[PeriodDate]; </code></pre> <p>works perfectly now that I have deleted the Order By clause from the Property sheet. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload