If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Format a text box!
[tblInvoice].[ClientDetail] Only appears in the table when there is no
funGetHorse, what i trying to do is get foward slash "/" to appear in front of tblInvoice.ClientDetail and not show after FunGetHorse and OwnerPercent As you see below "/" is appearing after OwmerPercent Pancho @ 100%/ (this is wrong) Joe Blogs / ClientDetail (This is Correct) SELECT tblInvoice.OwnerID, tblInvoice.OwnerName, tblInvoice.InvoiceDate AS OnDate,iif(tblInvoice.ClientInvoice=true,tblInvoic e.OwnerName,funGetHorse(tblInvoice.InvoiceID) & " @ " & Format(tblInvoice.OwnerPercent,"0.0%"))&("/"& [tblInvoice].[ClientDetail]) AS Description, tblInvoice.OwnerPercentAmount AS AmountSummary, tblInvoice.InvoiceID, tblInvoice.InvoiceNo,0 AS Flag -- Thanks in advance for any help with this......Bob MS Access 2007 accdb Windows XP Home Edition Ver 5.1 Service Pack 3 |
#2
|
|||
|
|||
Format a text box!
Bob Vance wrote:
[tblInvoice].[ClientDetail] Only appears in the table when there is no funGetHorse, what i trying to do is get foward slash "/" to appear in front of tblInvoice.ClientDetail and not show after FunGetHorse and OwnerPercent As you see below "/" is appearing after OwmerPercent Pancho @ 100%/ (this is wrong) Joe Blogs / ClientDetail (This is Correct) SELECT tblInvoice.OwnerID, tblInvoice.OwnerName, tblInvoice.InvoiceDate AS OnDate,iif(tblInvoice.ClientInvoice=true,tblInvoi ce.OwnerName, funGetHorse(tblInvoice.InvoiceID) & " @ " & Format(tblInvoice.OwnerPercent,"0.0%"))&("/"& [tblInvoice].[ClientDetail]) AS Description, tblInvoice.OwnerPercentAmount AS AmountSummary, tblInvoice.InvoiceID, tblInvoice.InvoiceNo,0 AS Flag Can't you just move the & "/" to where you want it inside the IIf? -- Marsh MVP [MS Access] |
#3
|
|||
|
|||
Format a text box!
IF ClientDetail is NULL then you can use this concatenation trick.
"XXX" & Null returns "XXX" "XXX" + Null returns Null IIF(tblInvoice.ClientInvoice=true ,tblInvoice.OwnerName ,funGetHorse(tblInvoice.InvoiceID) & " @ " & Format(tblInvoice.OwnerPercent,"0.0%")) & ("/" + [tblInvoice].[ClientDetail]) OR more general and not relying on the "concatenation trick" you can use the following if ClientDetail might be a zero-length string "" or null. IIF(tblInvoice.ClientInvoice=true ,tblInvoice.OwnerName ,funGetHorse(tblInvoice.InvoiceID) & " @ " & Format(tblInvoice.OwnerPercent,"0.0%")) & IIF(Len([ClientDetail & "") = 0,"",("/" & [tblInvoice].[ClientDetail])) John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Bob Vance wrote: [tblInvoice].[ClientDetail] Only appears in the table when there is no funGetHorse, what i trying to do is get foward slash "/" to appear in front of tblInvoice.ClientDetail and not show after FunGetHorse and OwnerPercent As you see below "/" is appearing after OwmerPercent Pancho @ 100%/ (this is wrong) Joe Blogs / ClientDetail (This is Correct) SELECT tblInvoice.OwnerID, tblInvoice.OwnerName, tblInvoice.InvoiceDate AS OnDate,iif(tblInvoice.ClientInvoice=true,tblInvoic e.OwnerName,funGetHorse(tblInvoice.InvoiceID) & " @ " & Format(tblInvoice.OwnerPercent,"0.0%"))&("/"& [tblInvoice].[ClientDetail]) AS Description, tblInvoice.OwnerPercentAmount AS AmountSummary, tblInvoice.InvoiceID, tblInvoice.InvoiceNo,0 AS Flag |
Thread Tools | |
Display Modes | |
|
|