M
Mark
I entered a somewhat complex query into Access by typing
the sql in by hand in the query builder. The Query
executes fine...but everytime I close and re-open the
Query and view the SQL, it has been automatically
reformatted. Brackets are put in places that where
previously parenthesis. The Query still executes but is
no longer compatible with other databases.
Thanks in advance.
Mark
It goes from:
SELECT ActionTaskQuery1.Actionsid, ActionTaskQuery1.Name,
ActionTaskQuery1.Starttime, ActionTaskQuery1.Endtime,
ActionTaskQuery1.Actionnote,
ActionTaskQuery1.Currentstatus,
ActionTaskLookAheadQuery.Lookaheaddate
FROM (SELECT (Date() + R_lookahead.Incrementday) AS
Lookaheaddate, R_lookahead.Lookaheadweeks
FROM R_lookahead
WHERE R_lookahead.Lookaheadweeks<=1) AS
ActionTaskLookAheadQuery LEFT JOIN (SELECT
Actions.Actionsid, Actions.Name, Actiontimes.Starttime,
Actiontimes.Endtime, Actionnote.Actionnote,
Actions.Currentstatus, DateValue(Actiontimes.Starttime)
AS Startdate, DateValue(Actiontimes.Endtime) AS Enddate
FROM (Actions LEFT JOIN Actionnote ON
Actions.Actionsid=Actionnote.Actionsid) INNER JOIN
Actiontimes ON Actions.Actionsid=Actiontimes.Actionsid)
AS ActionTaskQuery1 ON
(ActionTaskLookAheadQuery.Lookaheaddate<=ActionTaskQuery1.
Enddate) AND
(ActionTaskLookAheadQuery.Lookaheaddate>=ActionTaskQuery1.
Startdate);
To:
SELECT ActionTaskQuery1.Actionsid, ActionTaskQuery1.Name,
ActionTaskQuery1.Starttime, ActionTaskQuery1.Endtime,
ActionTaskQuery1.Actionnote,
ActionTaskQuery1.Currentstatus,
ActionTaskLookAheadQuery.Lookaheaddate
FROM [SELECT (Date() + R_lookahead.Incrementday) AS
Lookaheaddate, R_lookahead.Lookaheadweeks
FROM R_lookahead
WHERE R_lookahead.Lookaheadweeks<=1]. AS
ActionTaskLookAheadQuery LEFT JOIN [SELECT
Actions.Actionsid, Actions.Name, Actiontimes.Starttime,
Actiontimes.Endtime, Actionnote.Actionnote,
Actions.Currentstatus, DateValue(Actiontimes.Starttime)
AS Startdate, DateValue(Actiontimes.Endtime) AS Enddate
FROM (Actions LEFT JOIN Actionnote ON
Actions.Actionsid=Actionnote.Actionsid) INNER JOIN
Actiontimes ON Actions.Actionsid=Actiontimes.Actionsid].
AS ActionTaskQuery1 ON
(ActionTaskLookAheadQuery.Lookaheaddate>=ActionTaskQuery1.
Startdate) AND
(ActionTaskLookAheadQuery.Lookaheaddate<=ActionTaskQuery1.
Enddate);
the sql in by hand in the query builder. The Query
executes fine...but everytime I close and re-open the
Query and view the SQL, it has been automatically
reformatted. Brackets are put in places that where
previously parenthesis. The Query still executes but is
no longer compatible with other databases.
Thanks in advance.
Mark
It goes from:
SELECT ActionTaskQuery1.Actionsid, ActionTaskQuery1.Name,
ActionTaskQuery1.Starttime, ActionTaskQuery1.Endtime,
ActionTaskQuery1.Actionnote,
ActionTaskQuery1.Currentstatus,
ActionTaskLookAheadQuery.Lookaheaddate
FROM (SELECT (Date() + R_lookahead.Incrementday) AS
Lookaheaddate, R_lookahead.Lookaheadweeks
FROM R_lookahead
WHERE R_lookahead.Lookaheadweeks<=1) AS
ActionTaskLookAheadQuery LEFT JOIN (SELECT
Actions.Actionsid, Actions.Name, Actiontimes.Starttime,
Actiontimes.Endtime, Actionnote.Actionnote,
Actions.Currentstatus, DateValue(Actiontimes.Starttime)
AS Startdate, DateValue(Actiontimes.Endtime) AS Enddate
FROM (Actions LEFT JOIN Actionnote ON
Actions.Actionsid=Actionnote.Actionsid) INNER JOIN
Actiontimes ON Actions.Actionsid=Actiontimes.Actionsid)
AS ActionTaskQuery1 ON
(ActionTaskLookAheadQuery.Lookaheaddate<=ActionTaskQuery1.
Enddate) AND
(ActionTaskLookAheadQuery.Lookaheaddate>=ActionTaskQuery1.
Startdate);
To:
SELECT ActionTaskQuery1.Actionsid, ActionTaskQuery1.Name,
ActionTaskQuery1.Starttime, ActionTaskQuery1.Endtime,
ActionTaskQuery1.Actionnote,
ActionTaskQuery1.Currentstatus,
ActionTaskLookAheadQuery.Lookaheaddate
FROM [SELECT (Date() + R_lookahead.Incrementday) AS
Lookaheaddate, R_lookahead.Lookaheadweeks
FROM R_lookahead
WHERE R_lookahead.Lookaheadweeks<=1]. AS
ActionTaskLookAheadQuery LEFT JOIN [SELECT
Actions.Actionsid, Actions.Name, Actiontimes.Starttime,
Actiontimes.Endtime, Actionnote.Actionnote,
Actions.Currentstatus, DateValue(Actiontimes.Starttime)
AS Startdate, DateValue(Actiontimes.Endtime) AS Enddate
FROM (Actions LEFT JOIN Actionnote ON
Actions.Actionsid=Actionnote.Actionsid) INNER JOIN
Actiontimes ON Actions.Actionsid=Actiontimes.Actionsid].
AS ActionTaskQuery1 ON
(ActionTaskLookAheadQuery.Lookaheaddate>=ActionTaskQuery1.
Startdate) AND
(ActionTaskLookAheadQuery.Lookaheaddate<=ActionTaskQuery1.
Enddate);