Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

RE: Subject: Subquery in a textbox's control source

Discussion in 'Information Technology' started by George, Oct 26, 2005.

  1. George

    George
    Expand Collapse
    Guest

    Many thanks for your reply Ofer.

    Thanks for explaining how this query would work using the dLookup function.
    I'll mark your post as answered when I get home. This work pc is locked down
    and I can't use activeX. My original sql and the DLookup that solved the
    problem are noted below:

    SELECT payScale.psPayment, payScale.psLower, payScale.psUpper
    FROM payScale
    WHERE (((payScale.psLower)<SumOfAmount) AND ((payScale.psUpper)>SumOfAmount));

    =DLookUp("[psPayment]","payScale","[psLower] < " &
    Reports!transfersAwaitingPayment!SumOfAmount & " and [psUpper] > " &
    Reports!transfersAwaitingPayment!SumOfAmount)


    George


    "Ofer" wrote:

    > Try this
    >
    > =DLookUp("commissionAmount","payScale","lowerLimit > " & [myVariableValue] &
    > " and upperLimit < " & [myVariableValue])
    > --
    > If I answered your question, please mark it as an answer. That way, it will
    > stay saved for a longer time, so other can benifit from it.
    >
    > Good luck
    >
    >
    >
    > "George" wrote:
    >
    > > Hi Folks, hope someone can help.
    > >
    > > Based on a value on a report (eg £10,000) I want to Identify the amount of
    > > comission to pay to an adviser. EG, if the value is 10,000, commision = 50;
    > > 15,000 then commision = 75 etc. DLookup will not work (I don't think) as I
    > > need to test against two values. My SQL looks a bit like this:
    > >
    > > SELECT commissionAmount
    > > FROM payScale
    > > WHERE lowerLimit>[myVariableValue] and upperLimit<[myVariableValue]
    > >
    > > Hope that makes a bit of sense!
    > >
    > > George
    > >
    > >
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Sikh Women Group on Motorway Inferno Subjected to Racist Abuse Breaking News Aug 4, 2009
    Topical subjects in the SGGS Discourses in English Dec 16, 2006
    God-Subjective & Objective view points Spiritual Articles Jan 29, 2006
    SSC examinees fare poorly in secular subjects (News From Bangladesh) Interfaith Dialogues Jul 15, 2005

Share This Page