PC Review


Reply
Thread Tools Rate Thread

Add one field to an expression in query

 
 
Bob Vance
Guest
Posts: n/a
 
      13th Nov 2008
I wanted to add: ' / ' tblInvoice.ClientDetail
at the end of this expression, could someone help me with this....Thanks Bob

OwnerName: IIf(funGetHorse(tblInvoice.InvoiceID,0)='
',tblInvoice.OwnerName+'
'+funGetHorse(tblInvoice.InvoiceID,0),tblInvoice.OwnerName+' /
'+funGetHorse(tblInvoice.InvoiceID,0))

--
Thanks in advance for any help with this......Bob
MS Access 2007 accdb
Windows XP Home Edition Ver 5.1 Service Pack 3


 
Reply With Quote
 
 
 
 
Clifford Bass
Guest
Posts: n/a
 
      13th Nov 2008
Hi Bob,

First off, it may be better to use the concatenate operator, which is
the ampersand (&). That will avoid any confusion as to whether you are
wanting to add or concatenate. Then just add the stuff you want onto the end:

OwnerName: IIf(funGetHorse(tblInvoice.InvoiceID,0)='
',tblInvoice.OwnerName & '
' & funGetHorse(tblInvoice.InvoiceID,0),tblInvoice.OwnerName & ' /
' & funGetHorse(tblInvoice.InvoiceID,0)) & ' / ' & tblInvoice.ClientDetail

Hope this helps,

Clifford Bass



"Bob Vance" wrote:

> I wanted to add: ' / ' tblInvoice.ClientDetail
> at the end of this expression, could someone help me with this....Thanks Bob
>
> OwnerName: IIf(funGetHorse(tblInvoice.InvoiceID,0)='
> ',tblInvoice.OwnerName+'
> '+funGetHorse(tblInvoice.InvoiceID,0),tblInvoice.OwnerName+' /
> '+funGetHorse(tblInvoice.InvoiceID,0))
>
> --
> Thanks in advance for any help with this......Bob
> MS Access 2007 accdb
> Windows XP Home Edition Ver 5.1 Service Pack 3
>
>
>

 
Reply With Quote
 
Bob Vance
Guest
Posts: n/a
 
      13th Nov 2008
Thanks Clifford Billiant,any chance of dropping the '/' if there is a
funGetHorse because if there is a funGetHorse there will be no ClientDetail
so in that case I am getting : Owner / funGetHorse /
regards Bob

"Clifford Bass" <(E-Mail Removed)> wrote in message
news:9A89DD60-D135-4FA4-953D-(E-Mail Removed)...
> Hi Bob,
>
> First off, it may be better to use the concatenate operator, which is
> the ampersand (&). That will avoid any confusion as to whether you are
> wanting to add or concatenate. Then just add the stuff you want onto the
> end:
>
> OwnerName: IIf(funGetHorse(tblInvoice.InvoiceID,0)='
> ',tblInvoice.OwnerName & '
> ' & funGetHorse(tblInvoice.InvoiceID,0),tblInvoice.OwnerName & ' /
> ' & funGetHorse(tblInvoice.InvoiceID,0)) & ' / ' & tblInvoice.ClientDetail
>
> Hope this helps,
>
> Clifford Bass
>
>
>
> "Bob Vance" wrote:
>
>> I wanted to add: ' / ' tblInvoice.ClientDetail
>> at the end of this expression, could someone help me with this....Thanks
>> Bob
>>
>> OwnerName: IIf(funGetHorse(tblInvoice.InvoiceID,0)='
>> ',tblInvoice.OwnerName+'
>> '+funGetHorse(tblInvoice.InvoiceID,0),tblInvoice.OwnerName+' /
>> '+funGetHorse(tblInvoice.InvoiceID,0))
>>
>> --
>> Thanks in advance for any help with this......Bob
>> MS Access 2007 accdb
>> Windows XP Home Edition Ver 5.1 Service Pack 3
>>
>>
>>




 
Reply With Quote
 
Bob Vance
Guest
Posts: n/a
 
      13th Nov 2008
Thanks, Would be good if [& ' / ' & tblInvoice.ClientDetail] Only appears if
there was no funGetHorse
Regards Bob


"Bob Vance" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks Clifford Billiant,any chance of dropping the '/' if there is a
> funGetHorse because if there is a funGetHorse there will be no
> ClientDetail
> so in that case I am getting : Owner / funGetHorse /
> regards Bob
>
> "Clifford Bass" <(E-Mail Removed)> wrote in message
> news:9A89DD60-D135-4FA4-953D-(E-Mail Removed)...
>> Hi Bob,
>>
>> First off, it may be better to use the concatenate operator, which is
>> the ampersand (&). That will avoid any confusion as to whether you are
>> wanting to add or concatenate. Then just add the stuff you want onto the
>> end:
>>
>> OwnerName: IIf(funGetHorse(tblInvoice.InvoiceID,0)='
>> ',tblInvoice.OwnerName & '
>> ' & funGetHorse(tblInvoice.InvoiceID,0),tblInvoice.OwnerName & ' /
>> ' & funGetHorse(tblInvoice.InvoiceID,0)) & ' / ' &
>> tblInvoice.ClientDetail
>>
>> Hope this helps,
>>
>> Clifford Bass
>>
>>
>>
>> "Bob Vance" wrote:
>>
>>> I wanted to add: ' / ' tblInvoice.ClientDetail
>>> at the end of this expression, could someone help me with this....Thanks
>>> Bob
>>>
>>> OwnerName: IIf(funGetHorse(tblInvoice.InvoiceID,0)='
>>> ',tblInvoice.OwnerName+'
>>> '+funGetHorse(tblInvoice.InvoiceID,0),tblInvoice.OwnerName+' /
>>> '+funGetHorse(tblInvoice.InvoiceID,0))
>>>
>>> --
>>> Thanks in advance for any help with this......Bob
>>> MS Access 2007 accdb
>>> Windows XP Home Edition Ver 5.1 Service Pack 3
>>>
>>>
>>>

>
>
>



 
Reply With Quote
 
Clifford Bass
Guest
Posts: n/a
 
      13th Nov 2008
Hi Bob,

Your are welcome.

If I understand what is going on; try moving the last paranthesis to
the end. However, as I look at it a bit more, you may be able to simplify
the statement. Assuming that you want just

OwnerName

when funGetHorse(tblInvoice.InvoiceID,0)=' '

or

OwnerName / funGetHorse(tblInvoice.InvoiceID,0) / ClientDetail

when funGetHorse(tblInvoice.InvoiceID,0)<> ' ' change your statement to

OwnerName: tblInvoice.OwnerName & IIf(funGetHorse(tblInvoice.InvoiceID,0)='
', '', ' / ' & funGetHorse(tblInvoice.InvoiceID,0) & ' / ' &
tblInvoice.ClientDetail)

Clifford Bass

"Bob Vance" wrote:

> Thanks, Would be good if [& ' / ' & tblInvoice.ClientDetail] Only appears if
> there was no funGetHorse
> Regards Bob
>
>
> "Bob Vance" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Thanks Clifford Billiant,any chance of dropping the '/' if there is a
> > funGetHorse because if there is a funGetHorse there will be no
> > ClientDetail
> > so in that case I am getting : Owner / funGetHorse /
> > regards Bob
> >
> > "Clifford Bass" <(E-Mail Removed)> wrote in message
> > news:9A89DD60-D135-4FA4-953D-(E-Mail Removed)...
> >> Hi Bob,
> >>
> >> First off, it may be better to use the concatenate operator, which is
> >> the ampersand (&). That will avoid any confusion as to whether you are
> >> wanting to add or concatenate. Then just add the stuff you want onto the
> >> end:
> >>
> >> OwnerName: IIf(funGetHorse(tblInvoice.InvoiceID,0)='
> >> ',tblInvoice.OwnerName & '
> >> ' & funGetHorse(tblInvoice.InvoiceID,0),tblInvoice.OwnerName & ' /
> >> ' & funGetHorse(tblInvoice.InvoiceID,0)) & ' / ' &
> >> tblInvoice.ClientDetail
> >>
> >> Hope this helps,
> >>
> >> Clifford Bass

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
use expression as field name in query Larry Microsoft Access Queries 2 18th Feb 2008 03:18 PM
expression in a query field =?Utf-8?B?cmFt?= Microsoft Access 2 25th Jun 2007 07:24 PM
expression and new field on query Marko Microsoft Access Queries 5 3rd Apr 2004 02:48 AM
Field query expression Dave Microsoft Access Queries 1 13th Feb 2004 11:16 PM
expression for query to divide field A by field B chase Microsoft Access Queries 1 21st Dec 2003 02:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:55 AM.