Bruce:  Not sure what the problem is.  I just tried this and it works fine:
set var vcolname = 'client'set var vtablename = 'hours'
select &vcolname from &vtablenameselect &vcolname into vtext from &vtablename 
where limit = 1


Karen
 
 
 
-----Original Message-----
From: Bruce Chitiea <rby...@safesectors.com>
To: rbase-l@googlegroups.com <rbase-l@googlegroups.com>
Sent: Fri, Dec 10, 2021 3:21 pm
Subject: [RBASE-L] - Ampersanding in the Dark

#yiv0293406899 #yiv0293406899xc5c9d1ecbca64b0 
#yiv0293406899x86b4dd35dfc94ef5a5432fdb70f5f643{font-family:'Segoe 
UI';font-size:12pt;}#yiv0293406899 blockquote.yiv0293406899cite 
{margin-left:5px;margin-right:0px;padding-left:10px;padding-right:0px;border-left:1px
 solid #cccccc;}#yiv0293406899 blockquote.yiv0293406899cite2 
{margin-left:5px;margin-right:0px;padding-left:10px;padding-right:0px;border-left:1px
 solid #cccccc;margin-top:3px;padding-top:0px;}#yiv0293406899 a img 
{border:0px;}#yiv0293406899 Gurus and Gurettes:
My greatest coding challenge remains the use of ampersand variables. I get the 
concept, but my execution ... hoo boy.
So here's what works:
   SELECT (MIN(cpoDate)) INTO vdateStart INDIC vind1 +     FROM cpoHeader WHERE 
(IYR4(cpoDate)) = .vyearStart
But I need to sub-out the table name, and column name 'cpoDate' with the likes 
of 'invDate', 'shipDate', etc. This does the trick for the column name:
   SET VAR vcol_date TEXT = 'cpoDate'   SET VAR vamp_dateCol_min  TEXT = 
'(MIN(&vcol_date))'   SET VAR vamp_dateCol_iyr4 TEXT = '(IYR4(&vcol_date))'
   SELECT &vamp_dateCol_min INTO vfts_dateStart INDICATOR vind1 +     FROM 
cpoHeader WHERE &vamp_dateCol_iyr4 = .vyearStart
... but only so long as the literal tablename 'cpoHeader' is included in the 
FROM clause.
This returns a syntax error:   SET VAR vtableName TEXT = 'cpoHeader'   SELECT 
... FROM .vtableName ...
... as does this:   SET VAR vtableName TEXT = 'cpoHeader'   SELECT ... FROM 
&vtableName ...
... as does this:   SET VAR vtableName TEXT = 'cpoHeader'   SET VAR 
vamp_from_tablename TEXT = 'FROM .vtableName'   SELECT ... &vamp_from_tableName 
...
... as does this   SET VAR vtableName TEXT = 'cpoHeader'   SET VAR 
vamp_from_tablename TEXT = 'FROM &vtableName'   SELECT ... &vamp_from_tableName 
...
Clearly, I'm flailing. Any assistance much appreciated! Bruce
Bruce A. Chitiea | SafeSectors, Inc.112 Harvard Ave #272 | Claremont CA 
91711-4716 | usarby...@safesectors.com | +011 (909) 238-9012 c | +011 (909) 
912-8678 f



-- 
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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/emefc63529-209a-44f7-a4c9-390b1f709fa9%40pathfinder.

-- 
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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/780941412.690465.1639178950730%40mail.yahoo.com.

Reply via email to