Ernesto_Paez
MIS
Hi everyone,
Here is my issue.
i have created a form with a txtbox and search button, so as a user, i want to type a "value in that txtbox" to fetch the records for custno i typed in the txtbox, so i have been trying to figure out the needed "select sql" in the search button but it is complicated for me, so let me give you some insights.
tables names
arcust04.dbf (fields are custno, company,contact, address1. address2, state, zip country, phone and so other fields)
arcadr04 .dbf (fields are custno, company,contact, address1. address2, state, zip country, phone and so other fields)
1-So what i need to accomplish is type a custno in the txtbox and search for a "custno" in "arcust04.dbf first" and find if that "custno" is also in "arcadr04.dbf" if found in both tables, we need to pull from "arcadr04" fields values "custno, company,contact, address1, address2, state, zip country, phone" then show them in a grid, so it could be one one record or more under the same custno in "arcadr04.dbf" , why i need to pull from "arcadr04" ? because this table contains the "Ship to" info based on the fields listed above.
2- if the custno is only found in arcust04, then we need to put in the grid the "company,contact, address1 and the rest of the field values mentioned in 1, from "arcust04".
3- if the custno we are fetching is not in "arcust04" and it is "arcadr04" then we need to pull the needed fields values from arcadr04 in the grid as mentioned in 1
Note: the common fields in both tables has the same structure but both tables do not have all the the same fields, only those mentioned above.
can anyone please help on constructing this SELECT
Thanks so much
Ernesto
Here is my issue.
i have created a form with a txtbox and search button, so as a user, i want to type a "value in that txtbox" to fetch the records for custno i typed in the txtbox, so i have been trying to figure out the needed "select sql" in the search button but it is complicated for me, so let me give you some insights.
tables names
arcust04.dbf (fields are custno, company,contact, address1. address2, state, zip country, phone and so other fields)
arcadr04 .dbf (fields are custno, company,contact, address1. address2, state, zip country, phone and so other fields)
1-So what i need to accomplish is type a custno in the txtbox and search for a "custno" in "arcust04.dbf first" and find if that "custno" is also in "arcadr04.dbf" if found in both tables, we need to pull from "arcadr04" fields values "custno, company,contact, address1, address2, state, zip country, phone" then show them in a grid, so it could be one one record or more under the same custno in "arcadr04.dbf" , why i need to pull from "arcadr04" ? because this table contains the "Ship to" info based on the fields listed above.
2- if the custno is only found in arcust04, then we need to put in the grid the "company,contact, address1 and the rest of the field values mentioned in 1, from "arcust04".
3- if the custno we are fetching is not in "arcust04" and it is "arcadr04" then we need to pull the needed fields values from arcadr04 in the grid as mentioned in 1
Note: the common fields in both tables has the same structure but both tables do not have all the the same fields, only those mentioned above.
can anyone please help on constructing this SELECT
Thanks so much
Ernesto