Query Return Value

fahur

New member
Local time
Today, 19:42
Joined
Nov 9, 2005
Messages
8
Hi!

How to run and read a return value form a query?

I have two following queries:

Form first one I want to get "number" as a integer variable, eg. "numberVar":

SELECT LAST(number) FROM NE_Data WHERE NE_number=X;

than I should insert "numberVar" into second query:

SELECT port_number_new FROM NE_data WHERE number=numberVar;

and read a return value to insert into a new record (control in a form).

Can someone help?

Thanks in advance for reply...

--
fahur
 
Create a query Lets call it MyQuery for this example:
SELECT port_number_new as NewNum
FROM NE_data
WHERE number = (SELECT LAST(number) FROM NE_Data WHERE NE_number=X; )
From where ever you want the value to be inserted into the new record:
Variable or FormField = Dlookup("NewNum","MyQuery")

Bascially
 

Users who are viewing this thread

Back
Top Bottom