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

    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...
  3. 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...
Top Bottom