UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> How To Fix A 0 Attribute Expression, Access 2016    
 
   
ppcaccesshelp
post Apr 16 2018, 08:51 PM
Post#1



Posts: 19
Joined: 13-April 18



Some of my attributes in venue type are 0 ... how do i write the expression so that if the venue type is 0, use "Category"?

Final URL: Replace([Export]![Venue/Performer URL],"www",[Export]![CityNoSpace] & [VenueLookupMasterSheet]![Venue Type])

Thank you!
Go to the top of the page
 
GroverParkGeorge
post Apr 16 2018, 08:54 PM
Post#2


UA Admin
Posts: 33,760
Joined: 20-June 02
From: Newcastle, WA


Try this:

Final URL: Replace([Export]![Venue/Performer URL],"www",[Export]![CityNoSpace] & Iif([VenueLookupMasterSheet]![Venue Type]= 0, "Category", [VenueLookupMasterSheet]![Venue Type]))
Go to the top of the page
 
ppcaccesshelp
post Apr 16 2018, 09:16 PM
Post#3



Posts: 19
Joined: 13-April 18



Returns an Error
Go to the top of the page
 
zaxbat
post Apr 16 2018, 09:24 PM
Post#4



Posts: 1,184
Joined: 26-January 06
From: .....the wiregrass (either you know or you don't)


What value is expected in the venue type? is it string or numeric or something else? Is venue type allowed to be "Category" or is it something else? And, what is the error you get?
This post has been edited by zaxbat: Apr 16 2018, 09:27 PM
Go to the top of the page
 
ppcaccesshelp
post Apr 16 2018, 09:40 PM
Post#5



Posts: 19
Joined: 13-April 18



Venue Type is a table with text when no venue type is available it is 0 the error is in the query table #error
Go to the top of the page
 
WildBird
post Apr 16 2018, 09:43 PM
Post#6


UtterAccess VIP
Posts: 3,417
Joined: 19-August 03
From: Auckland, Little Australia


Whats the error and is [VenueLookupMasterSheet]![Venue Type] a number or text?

Try
Final URL: Replace([Export]![Venue/Performer URL],"www",[Export]![CityNoSpace] & Iif([VenueLookupMasterSheet]![Venue Type]= "0", "Category", [VenueLookupMasterSheet]![Venue Type]))
Go to the top of the page
 
ppcaccesshelp
post Apr 16 2018, 09:57 PM
Post#7



Posts: 19
Joined: 13-April 18



Perfect! Thank you smile.gif that worked
Go to the top of the page
 
zaxbat
post Apr 17 2018, 06:09 AM
Post#8



Posts: 1,184
Joined: 26-January 06
From: .....the wiregrass (either you know or you don't)


iconfused.gif
isn't that the same as first answer?
Go to the top of the page
 
cheekybuddha
post Apr 17 2018, 08:18 AM
Post#9


UtterAccess VIP
Posts: 10,432
Joined: 6-December 03
From: Telegraph Hill


Not quite ...
CODE
...  & Iif([VenueLookupMasterSheet]![Venue Type]= "0", ...
...  & Iif([VenueLookupMasterSheet]![Venue Type]= 0, ...

dazed.gif

thumbup.gif

d
Go to the top of the page
 
zaxbat
post Apr 17 2018, 08:55 AM
Post#10



Posts: 1,184
Joined: 26-January 06
From: .....the wiregrass (either you know or you don't)


There's a good lesson in that......

I did not put the two lines together for a closer comparison and missed the number vs. string on the zero. dunce.gif
Go to the top of the page
 
cheekybuddha
post Apr 17 2018, 09:40 AM
Post#11


UtterAccess VIP
Posts: 10,432
Joined: 6-December 03
From: Telegraph Hill


It's the sort of thing you can stare at for days without seeing!
Go to the top of the page
 
GroverParkGeorge
post Apr 17 2018, 09:44 AM
Post#12


UA Admin
Posts: 33,760
Joined: 20-June 02
From: Newcastle, WA


That's definitely a "doh". I was wondering, in fact, why a 0 would be replaced by "Category", when other entries would be either other digits or other strings. And, yes, of course, it's a string too.

Oh well. You caught it and that's what matters.
Go to the top of the page
 
cheekybuddha
post Apr 17 2018, 09:47 AM
Post#13


UtterAccess VIP
Posts: 10,432
Joined: 6-December 03
From: Telegraph Hill


I trust your reply is aimed at Coop, George? Nothing to do with me!
Go to the top of the page
 
GroverParkGeorge
post Apr 17 2018, 09:53 AM
Post#14


UA Admin
Posts: 33,760
Joined: 20-June 02
From: Newcastle, WA


Didn't you point out the difference between "0" and 0 ?
Go to the top of the page
 
cheekybuddha
post Apr 17 2018, 10:03 AM
Post#15


UtterAccess VIP
Posts: 10,432
Joined: 6-December 03
From: Telegraph Hill


I only pointed out the difference in Coop's answer in post #6.

Sadly, I can't claim to have come up with the solution!
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    17th October 2018 - 07:38 PM