How about something like this.

--defined in on start eep for report
SET VAR vcolumn TEXT, vpartnum2 TEXT

--before generate custom eep for detail section
IF vpltaccess2 = 'L' THEN
  SET VAR vcolumn = 'prisupplerl'
ELSE
  SET VAR vcolumn = 'prisupplierd'
ENDIF

SELECT partnum2 INTO vpartnum2 FROM mastervendors WHERE part#=part# AND
&vcolumn='Y'

RETURN

On Mon, Jul 25, 2022 at 4:19 PM Dan Goldberg <[email protected]> wrote:

> Yea that is what I did as a workaround but the report would be quicker if
> it only had to do one lookup.
>
>
>
> Dan Goldberg
>
>
>
> *From:* 'Karen Tellef' via RBASE-L <[email protected]>
> *Sent:* Monday, July 25, 2022 1:12 PM
> *To:* [email protected]
> *Subject:* Re: [RBASE-L] - using column name in report variables
>
>
>
> I don't think I've ever tried that, but I'm not surprised it doesn't work.
>
>
>
> If it was me, I would create 2 variables (I'm winging this, so syntax
> might not be exactly right):
>
>
>
> VpartlocA = partnum2 in mastervendors where part# = part# and PriSupplerL
> = 'Y'
>
> VpartlocB = partnum2 in mastervendors where part# = part# and PriSupplerD
> = 'Y'
>
>
>
> Vpartnum2 = (ifeq(vpltaccess2,'L', .vpartlocA, .vpartlocB))
>
>
>
>
>
> Karen
>
>
>
>
>
> -----Original Message-----
> From: Dan Goldberg <[email protected]>
> To: [email protected] <[email protected]>
> Sent: Mon, Jul 25, 2022 3:06 pm
> Subject: [RBASE-L] - using column name in report variables
>
> I have a few variables in a report.
>
>
>
> Vpartloc = (ifeq(vpltaccess2,'L','PriSupplerL','PriSupplerD'))
>
>
>
> I want to create a lookup based on that column name in vpartloc
>
>
>
> Vpartnum2 = partnum2 in mastervendors where part# = part# and &vpartloc =
> 'Y'
>
>
>
> I usually use the & symbol to substitute for the column name but it gives
> me an error when I try to save the variable.
>
>
>
> Any ideas why it does not work?
>
>
>
> TIA
>
>
>
> Dan Goldberg
>
>
>
> --
> For group guidelines, visit
> http://www.rbase.com/support/usersgroup_guidelines.php
> ---
> You received this message because you are subscribed to the Google Groups
> "RBASE-L" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rbase-l/2E4830CEC16615458329D3D83342F8D0014F0903AC%40EXCHANGE10
> <https://groups.google.com/d/msgid/rbase-l/2E4830CEC16615458329D3D83342F8D0014F0903AC%40EXCHANGE10?utm_medium=email&utm_source=footer>
> .
>
> --
> For group guidelines, visit
> http://www.rbase.com/support/usersgroup_guidelines.php
> ---
> You received this message because you are subscribed to the Google Groups
> "RBASE-L" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rbase-l/1042612017.1545249.1658779907686%40mail.yahoo.com
> <https://groups.google.com/d/msgid/rbase-l/1042612017.1545249.1658779907686%40mail.yahoo.com?utm_medium=email&utm_source=footer>
> .
>
> --
> For group guidelines, visit
> http://www.rbase.com/support/usersgroup_guidelines.php
> ---
> You received this message because you are subscribed to the Google Groups
> "RBASE-L" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rbase-l/2E4830CEC16615458329D3D83342F8D0014F09041B%40EXCHANGE10
> <https://groups.google.com/d/msgid/rbase-l/2E4830CEC16615458329D3D83342F8D0014F09041B%40EXCHANGE10?utm_medium=email&utm_source=footer>
> .
>

-- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/CADeqk-5aBQGcSgQ_fcBbuQ-ErCxAwkvSuVpkBRDBqjDaKuS4jA%40mail.gmail.com.

Reply via email to