> >testconnString = "Select MAX(iDate) As iDate From (Select MAX(idate) As iDate From webprddt7.qms8dprevn Where edindex = 870871 And editeratn = 2" +; >" Union All Select MAX(idate) As iDate From webprddt7.qms8dcntrl Where edindex = 870871 And editeratn = 2" +; >" Union All Select MAX(idate) As iDate From webprddt7.qms8dvers1 Where edindex = 870871 And editeratn = 2" +; >" Union All Select MAX(idate) As iDate From webprddt7.qms8dpca Where edindex = 870871 And editeratn = 2" +; >" Union All Select MAX(idate) As iDate From webprddt7.qms8dica Where edindex = 870871 And editeratn = 2) td" > >Use TEXT ENDTEXT in VFP when you build your string.
TEXT TO testconnString NOSHOW Select MAX(iDate) As iDate From (Select MAX(idate) As iDate From webprddt7.qms8dprevn Where edindex = 870871 And editeratn = 2 Union All Select MAX(idate) As iDate From webprddt7.qms8dcntrl Where edindex = 870871 And editeratn = 2 Union All Select MAX(idate) As iDate From webprddt7.qms8dvers1 Where edindex = 870871 And editeratn = 2 Union All Select MAX(idate) As iDate From webprddt7.qms8dpca Where edindex = 870871 And editeratn = 2 Union All Select MAX(idate) As iDate From webprddt7.qms8dica Where edindex = 870871 And editeratn = 2) td ENDTEXTAbout your request, what if you have the same date in several tables?