General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Try this. I know this example is redundant but it does what I think you described.
ljunkvar = .T. &&Or .f., it doesn't matter, but needs to be set first before the select statement.
SELECT junk(myyear) leaper, IIF(!EMPTY(m.ljunkvar), 'Yes', 'No ') leaper2 FROM table1 nowa
FUNCTION junk(tnyear)
IF TYPE('ljunkvar') != 'U'
RELEASE ljunkvar
PUBLIC ljunkvar
ENDIF
ljunkvar = MONTH(DATE(tnYear,2,28) + 1 ) = 2 &&Calculation to test for leap year. Returns a logical value.
RETURN ljunkvar
table1 contains only a single integer column with five records containing the 4-digit years of 1999 thru 2003.
>Hi All,
>
>I have a value that I am calculating with a UDF in a SQL statement in VFP 7. I want to use that same value, in the same statement, after it is calculated, however, it only seems to work if I create a second statement, that picks up the value.
>
>This would not be a big deal, except that there are about 4 layers of these dependant variables, so I end up execute 5 statements, when I would really like to do it in one.
>
>Any Ideas on How I can accomplish this in a single statment?
>
>Thanks.
>
>Daniel
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only