Combining Queries

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have several Queries that count field entries from last month and the prior
months. They seem to work great but I would like to combine these Queries
into one Query. It must be possible but I am failing at every turn. Anyone
have any ideas?

SQL Query One ...

SELECT Count(*) AS Name1
FROM (SELECT DISTINCT [table].[field]
FROM [table]
WHERE (((Month([Date]))=Month(DateAdd("m",-1,Now()))))
)

SQL Query Two ...

SELECT Count(*) AS Name2
FROM (SELECT DISTINCT [table].[field]
FROM [table]
WHERE (((Month([Date]))=Month(DateAdd("m",-2,Now()))))
)

SQL Query Three ...

SELECT Count(*) AS Name3
FROM (SELECT DISTINCT [table].[field]
FROM [table]
WHERE (((Month([Date]))=Month(DateAdd("m",-3,Now()))))
)

.



Relevant Pages

  • Index server Performance issues
    ... file types in the catalog. ... The SQL query we issue for this is: ... decreases to 15 seconds for 10 concurrent queries. ... The MaxActiveQueryThreads entry is the maximum number of active threads to ...
    (microsoft.public.inetserver.indexserver)
  • RE: How to discard the error in SQL query
    ... PrintError will just print the error and go on its merry way ... How to discard the error in SQL query ... I am executing list of SQL queries from a file. ...
    (perl.dbi.users)
  • SQL parsing library
    ... take an SQL query (which may already contain some ... metrics on the frequency and average running time of queries in the ... and I want to treat all queries of the same general form as ...
    (comp.lang.java.databases)
  • C# Excel multiple cell/column/row SQL Query Question
    ... I am trying to select a range of data within an excel spreadsheet using ... a SQL query. ... The two queries below do the trick but I was wondering if ... there's any way to combine both of these SQL queries into one query? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SQL parsing library
    ... > in mind is as follows: take an SQL query (which may already contain some ... > metrics on the frequency and average running time of queries in the ... and I want to treat all queries of the same general form as ...
    (comp.lang.java.databases)