Search results

  1. P

    Get next higher value OR if result empty: return max

    Hallo, I'm trying to create a query which returns me the next higher number: My table: tblPersons ID, Name, balance, 10 John 1000 11 Alice 2000 12 Bob 3000 My query: SELECT TOP 1 name FROM tblPersons WHERE( (balance)>([InputBalance])) ORDER BY balance ASC Input: [InputBalance] =...
  2. P

    Recursive table: Get all Childs for given Parent

    Thank you very much! => Problem solved :) Edit: Can someone tell me please where to mark this thread as "SOLVED"?
  3. P

    Recursive table: Get all Childs for given Parent

    Hm.. I thought my example was simple enough :( - sorry! tblPersons ist a Database with employees. id, reportsTo (=previously called parentId), FirstName Sample data: id reportsTo FirstName 1 NULL Peter 2 2 John 3 2 Anna 4 3 Tom 5...
  4. P

    Recursive table: Get all Childs for given Parent

    Hallo, I've a table that looks something like this: id, parentID, name ParentId links to id. Now I would like to get all "child-nodes" for a given parentId. The recursion goes 4 levels deep. What I've so far is: SELECT t1.id, t2.id, t3.id, t4.id FROM tblPersons AS t4 INNER JOIN...
  5. P

    Get value for field from another query

    Ok, here we go :) Sample data of tblDiscount Sample data of tblAdbCases Running (qryDiscountGet) SELECT TOP 1 discount FROM tblDiscount WHERE( (level)<=[p] ) ORDER BY levelDESC; Should return for [p]=7 "discount = 8.25 USD" Now I would like to create a query: "Show me all entries and...
  6. P

    Looking for best Antivirus Software

    I'm using kaspersky (KIS) for almost 7 years. No problems ever. You can download a free trial from their website.
  7. P

    New member and access user - therapy now required..

    Welcome from (cold) austria! :)
  8. P

    Get value for field from another query

    Hello, It might be a simple question but I don't know how to solve this: First: I've created a simple query which gives me the result for a given user input "p". SELECT TOP 1 val1 FROM tblPerson WHERE( (val2)<=[p] ) ORDER BY val2 DESC; Result looks like: Now I've a second query. I would...
  9. P

    Subqueries cannot be used in the expression...

    @plog You are right! Such an simple solution... I've totally forgotten that there is something like AVG :)
Top Bottom