Larry

I've been following this train with interest.

SET VAR vExpression = '((' + .vDollarColName + '/.vSalesLessReturns)*100)'

UPDATE ttblReportData +
  SET &vPctColName = &vExpression +
  WHERE &vDollarColName IS NOT NULL +
    AND &vPctColName IS NULL +
    AND StatementType <> 'BS'

Does this work?  It's very clever if it does!!

David Blocker

----- Original Message -----
From: "Lawrence Lustig" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 30, 2002 9:26 AM
Subject: Re: Using macro substitution after left paren in expression


> > How about:
> >
> > SET VAR vJunkFile TEXT = (FILENAME(0))
> > OUTPUT &vJunkFile
> > WRITE 'UPDATE ttblReportData SET', .vPctColName, '= +'
> > WRITE '((', .vDollarColName, '/', .vSalesLessReturns, ') * 100) +'
> > WRITE 'WHERE', .vDollarColName, 'IS NOT NULL AND +'
> > WRITE .vPctColName, 'IS NULL AND StatementType <> ''BS'''
> > WRITE 'RETURN'
> > OUTPUT SCREEN
> > RUN &vJunkFile
> > DELETE &vJunkFile
>
> Bill, this one also works fine.  Again, the only problem is how easily
> another programmer (or me, in six months), would be able to tell what the
> code is intended to do.  In particular, I would prefer a solution that
kept
> the dotted variables dotted and the ampersanded variables ampersanded to
> show which ones contain values and which ones contain column names.
>
> As it currently stands, my code looks like this:
>
> SET VAR vExpression = '((' + .vDollarColName + '/.vSalesLessReturns)*100)'
>
> UPDATE ttblReportData +
>   SET &vPctColName = &vExpression +
>   WHERE &vDollarColName IS NOT NULL +
>     AND &vPctColName IS NULL +
>     AND StatementType <> 'BS'
>
> --
> Larry
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: UNSUBSCRIBE rbase-l
> ================================================
> TO SEARCH ARCHIVES:
> http://www.mail-archive.com/rbase-l%40sonetmail.com/

================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to