Query params from a table

  • I need to create a query that dynamically receives it parameters from tbl_B.BeginDate & tbl_B.EndDate and then returns the records that fall between those values in tbl_A.BeginDate.

    tbl_A

    PKBeginDate
    112/1/2003
    21/1/2003
    32/1/2003
    43/1/2003
    54/1/2003
    65/1/2003
    76/1/2003

    tbl_B

    PKBeginDateEndDate
    112/1/20035/1/2003

    Is this possible?

    Thanks in advance!!

    Manuel

  • SELECT Tbl_A.PK, Tbl_A.BeginDt
    FROM Tbl_A
    WHERE (((Tbl_A.BeginDt) Between (SELECT Tbl_B.BeginDt FROM Tbl_B) And (SELECT Tbl_B.EndDt FROM Tbl_B)))

    But this is assuming there is only one record in TBL_B. If there are more than one the query won't work.



    ----------------
    Jim P.

    A little bit of this and a little byte of that can cause bloatware.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply