Double queries

Results 1 to 2 of 2

Thread: Double queries

  1. #1
    Join Date
    Dec 1969

    Default Double queries

    Little problem: <BR>I basically I have two stored queries in the database, the second works off of the query from the first. The first query needs a date to be passed to it. How can I send the date to this first query and then run the second one? Would it be easier to just copy the query strings from Access and paste them in the asp code? How would I pull this off? EX "Select * from stars;Select * from bill;"

  2. #2
    Join Date
    Dec 1969

    Default I don't think you can do it...

    ...quite that way.<BR><BR>If your subquery looks something like:<BR><BR>SELECT * FROM table2 WHERE field1=&#039;xyz&#039; AND dateField = INPUTDATE;<BR><BR>so that you interactively supply the date when running it form Access, then I think you need to change that subquery to simply:<BR><BR>SELECT * FROM table2 WHERE field1=&#039;xyz&#039;;<BR><BR>And now you use that in your second query thus:<BR><BR>SELECT * FROM table1, subquery <BR>WHERE =<BR>AND subquery.dateField = #5/5/2002#<BR><BR>In other words, you eliminate that field as an argument to the first (sub)query and then add it back in, effectively, when you do the JOIN.<BR><BR>Try it, maybe?<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts