Re: Ignore empty fields in Criteria append
- From: rej2008 <rej2008@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 10 Aug 2008 06:44:00 -0700
Thank you so much. That was helpful.
I am not an expert on Access, So if I can expand on that question:
- How do I export the data with some formatting, in to an Excel file.
I wanted to create a macro that would actually run this Qry and save it to
an Excel file and automatically open the Excel file.
- Couldn't figure out how to record a macro either as I am confused by their
new menus in Access 2007.
- is it true that Access 2007 will not allow you to save Report results as
Excel files? How do we then save the report results with certain formatting
to an excel file?
Thank you.
"Douglas J. Steele" wrote:
There are two distinct concatenation characters in Access..
& ignores Nulls, + doesn't.
In other words,
"x" & Null returns "x"
"x" + Null returns Null
Try:
Expr3: [Child1] & (", "+ [Child2]) & (", "+ [Child3]) & (", "+ [Child4]) &
(", "+ [Child5])
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"rej2008" <rej2008@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CBC5ECE8-93CF-4E98-8D46-FF019CB5CD2E@xxxxxxxxxxxxxxxx
I have a database with following fields.
PARENT_LName (Joe)
PARENT_FNAME (Smith)
Child1 (Shawn)
Child2 (Samantha)
Child3 (Tony)
Child4
Child5
I want to setup a criteria to report a list of all parents and their
childrens name as follows:
PARENT CHILDREN
Joe Smith Shawn, Samantha, Tony
I created a Query and tried to append the children's names using an
Expression such as the one below, but it didn't work, because it fails for
anybody who has less than 5 kids, because the expression doesn't get
evaluated if it sees an empty null field.
How can I tell it ignore Null fields and display the children's names
whether there is only 1, 2 or more.
Expr3: [Child1] + ", "+ [Child2] + ", "+ [Child3] + ", "+ [Child4] + ",
"+
[Child5]
- Follow-Ups:
- Re: Ignore empty fields in Criteria append
- From: bcap
- Re: Ignore empty fields in Criteria append
- References:
- Ignore empty fields in Criteria append
- From: rej2008
- Re: Ignore empty fields in Criteria append
- From: Douglas J. Steele
- Ignore empty fields in Criteria append
- Prev by Date: Re: Ignore empty fields in Criteria append
- Next by Date: Re: Ignore empty fields in Criteria append
- Previous by thread: Re: Ignore empty fields in Criteria append
- Next by thread: Re: Ignore empty fields in Criteria append
- Index(es):
Relevant Pages
|