Adding same amount of rows in a Query

Lochwood

Registered User.
Local time
Today, 08:08
Joined
Jun 7, 2017
Messages
130
I have a query with criteria based on a form field that then feeds a report. There are only 10 rows the table the query looks at and in this example the results are 3 rows based on the form.. what I need is for there to then be 7 blank rows below the results.. so I need there to always be 10 rows in the results even though some will have no data and be blank.. can I achieve this?
 
Sounds like you need a UNION query with the first element showing records that match your criteria and the second element showing records that don't but with null values replacing field names
 
you can do it on the report.
 
i am sorry but i have to go, if nobody answers you, tommorow i'll give you a sample.
 
Just tried this SQL on Table which had 10 entries

The first part of the SQL extracts surnames starting A,B or C

The second part extracts the rest but they just show as empty rows

Code:
SELECT
Surname,FirstName
 
FROM
MyTable
 
WHERE
Surname Like '[A-C*]'
 
UNION ALL SELECT
Null,Null
 
FROM
MyTable
 
WHERE
NOT Surname like '[A-C*]'
 

Users who are viewing this thread

Back
Top Bottom