Results 1 to 12 of 12

Thread: levels (2k)

  1. #1
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    levels (2k)

    in this attached mdb i have a feald contain numbers , it's devided 6 level
    1st level = 1 number
    2nd level=2 number
    from 3rd level to 6th level = 3 number
    i wnat to make a query to show a number but i want to put level 3 only show acc in level 3 or when i put 4 show acc in level 4
    it is a part of my accouantant mdb
    Ashraf

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: levels (2k)

    Hi Ashraf,

    Your attachment has not come through. Could you edit your post and attach it again? (It must be a .zip file of less than 100 KB)

  3. #3
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: levels (2k)

    Very Sorry . It is Here .
    Thanks Advanced
    Ashraf
    Attached Files Attached Files

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: levels (2k)

    What exactly is it you wish to do?
    Is it to take a number like 101002002 and show it like 1-01-002-002 in a query?
    If this is what you wish to do then I would use a public function to format the field for you.

    Pat

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: levels (2k)

    Does this query do something like what you want:

    PARAMETERS [Enter Level] Short;
    SELECT TAccounts.AccID, [Enter Level] AS [Level], IIf([Level]>2,3*[Level]-5,IIf([Level]>1,2,1)) AS Start, IIf([Level]>2,3,IIf([Level]>1,2,1)) AS Length, Mid([AccID],[Start],[Length]) AS AccLevel
    FROM TAccounts;

    To test it, create a new query, but don't add a table. Switch to SQL view (View | SQL), then paste the SQL string from this post into the query. When you switch to Datasheet view, you will be prompted for a level. Enter 1, 2, 3, 4, 5 or 6 and click OK.

  6. #6
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: levels (2k)

    Thank u Hans
    i do it really but when i put number 6 i see 001 in front of that no: 101004001001001 i want that number only display in the query , also if i put 3 the query dislay only acc in level 3

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: levels (2k)

    Hi Ashraf,

    It's hard to understand what you want, so I'm just guessing. Try this query:

    SELECT TAccounts.AccID
    FROM TAccounts
    WHERE Len([AccID])=IIf([Enter Level]>2,3*[Enter Level]-3,IIf([Enter Level]>1,3,1))

  8. #8
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: levels (2k)

    Hi Hans , U r understand what i want ecaxtly , U r very cliver
    Thank u very much
    Ashraf

  9. #9
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: levels (2k)

    Dear Hans can u do index depond on the levels .
    when i press 1 that level 1 when i add 01 index to 2nd level .... etc
    Ashraf

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: levels (2k)

    Hello Ashraf,

    I don't think you can do that in a query, but perhaps it is possible in a form based on the query. But I recommend that you think hard about what you want to accomplish with all this before continuing. Putting all levels into one string field is making things more complicated then necessary, I fear.

  11. #11
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: levels (2k)

    Hi Hans ,
    u r right i want it in a from not in query .
    Ashraf

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: levels (2k)

    Hello Ashraf,

    Since English is not my native language, I can understand that it must be difficult to express yourself clearly. But if you want the Lounge to help you, you must help us too, by doing your best to phrase your problem in a comprehensible manner. Please give us some details of what you want to do, not just one cryptic sentence.

Posting Permissions

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