1

I'm working on a query which is getting disgustingly large, and believe I can improve it by using a derived query; a more ornate and useful form of something like this:-

SELECT Id,
       RateId,
       FactorId
    FROM (SELECT Id,
                 RateId,
                 FactorId
              FROM SomeTable
              WHERE FactorId <> 0);

But when I try this it grizzles with an error message "Syntax Error in FROM Clause".

Before I start swearing at it to make it work, does Microsoft Access 97 support derived tables? If it doesn't, there's no point in continuing on these lines.

Brian Hooper
  • 21,544
  • 24
  • 88
  • 139
  • Microsoft does not support it, see: [Which versions of Office work with Windows 10?](https://support.microsoft.com/en-us/office/which-versions-of-office-work-with-windows-10-0fc85c97-da69-466e-b2b4-54f7d7275705?ui=en-us&rs=en-us&ad=us) – Luuk Jun 17 '22 at 11:04
  • @Luuk How this unsupportedness is related to OP question? – Arvo Jun 17 '22 at 11:05
  • Is "Microsoft Access 97" not part of an old Microsoft Office version ? – Luuk Jun 17 '22 at 11:08
  • 1
    You might see what happens when you add an **alias** to your sub-query. I think that is needed by SQL in general. – Luuk Jun 17 '22 at 11:14

1 Answers1

2

You probably need the old Access SQL sub-select syntax:

SELECT Id,
       RateId,
       FactorId
    FROM [SELECT Id,
                 RateId,
                 FactorId
              FROM SomeTable
              WHERE FactorId <> 0]. AS T;
Gustav
  • 53,498
  • 7
  • 29
  • 55