p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: Multiple Table Selection


Message #1 by Webmaster <webmaster@o...> on Wed, 20 Dec 2000 19:44:23 -0800

Is there a way to combine the two below into one SQL statement so that only 

one recordset needs to be opened?



SQLT = "SELECT Max(Mail_Date) AS NewMail FROM tblMail"



SQLT = "SELECT Max(Billing_Date) AS NewBilling From tblBilling"



Thanks



John





--- 

FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND

INSIGHTS IN YOUR INBOX!

Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb?s

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #2 by "Hoogwerf, Sander" <sander.hoogwerf@e...> on Wed, 20 Dec 2000 12:30:03 -0000
John,



You could try:



    SQLT =        "SELECT Max(Mail_Date) AS aMax, "MaxMail" as aName FROM

tblMail "

    SQLT = SQLT & "UNION "

    SQLT = SQLT & "SELECT Max(Billing_Date) AS aMax, "MaxBilling" as aName

FROM tblBilling "



This wil result in something like:



    aMax          aName   

    ------------- ---------- 

    dec-12-2000   MaxBilling

    dec-09-2000   MaxMail



    (2 row(s) affected)



Sander



-----Original Message-----

From: Webmaster [mailto:webmaster@o...]

Sent: 21 December 2000 04:44

To: ASP Databases

Subject: [asp_databases] Multiple Table Selection







Is there a way to combine the two below into one SQL statement so that only 

one recordset needs to be opened?



SQLT = "SELECT Max(Mail_Date) AS NewMail FROM tblMail"



SQLT = "SELECT Max(Billing_Date) AS NewBilling From tblBilling"



Thanks



John





--- 

NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS?  Is FREE okay?

Visit EarthWeb for the latest in IT Management, Software Development, 

Web Development, Networking & Communications, and Hardware & Systems.  

Click on http://www.earthweb.com for FREE articles, tutorials,

and discussions from the experts.

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com


  Return to Index