Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Maniumplating Data on retrieval

  1. #1
    Join Date
    Apr 2007
    Posts
    13

    Unhappy Maniumplating Data on retrieval

    Right here my Probelm. I have a dynamic drop down menu, which i am getting from a recordset called Parts. Simple SQL code

    SELECT Description, PartID
    FROM Part
    ORDER BY Description

    What i want to do, is place an "=" sign infront of all the PartID's. Is this possible

    so instead of displaying 1,2,3 it displays =1,=2,=3

    Any help would be great
    thanks

  2. #2
    Join Date
    May 2006
    Posts
    407
    SELECT Description, "=" & [PartID] AS PartID
    FROM Part
    ORDER BY Description;

    By why? Normally only the Description is shown in a combo, not the ID number. Are you showing both the description and the partID? Why are you showing the ID?????

  3. #3
    Join Date
    Apr 2007
    Posts
    13
    Basically i am using this to fill a dynamic drop down menu. The reason i want the = infront of the number is beasue i want to have a record which can select them all, i.e <>-1

    This was the simplest way i could think to do it.

  4. #4
    Join Date
    Apr 2007
    Posts
    13
    I tried that code and it does not appear to work? Can you confirm this is correct


    SELECT Description,"=" & [PartID] AS PartIDS
    FROM [Part]
    ORDER BY Description

  5. #5
    Join Date
    Apr 2007
    Posts
    13
    The last thing i should mention is i am using an access database. If that makes any difference.

    Thanks

  6. #6
    Join Date
    May 2006
    Posts
    407
    Quote Originally Posted by Vic
    SELECT Description, "=" & [PartID] AS PartID
    FROM Part
    ORDER BY Description;
    SELECT Description,"=" & [PartID] AS PartIDS
    FROM [Part]
    ORDER BY Description
    You could not see the differences between what I posted and what you posted?
    The only difference that I see that matters is the "S" on the end of PartID.
    But the big thing that is missing, is you say it does not appear to be working. Could you explain what is happening that makes it appear to not be working? Do you get and error message? If so, what is it and what does the message say? If you run this code and nothing happens, explain nothing. If all I know is it does not appear to work, I really have NOTHING to go on. Within reason, the more info you give us, the better chance we have of understanding what the problem is.

  7. #7
    Join Date
    Apr 2007
    Posts
    13
    Hi

    It simply says no value given for one or more require paramaters. I.e. it is not liking the "=" & [PartID] AS PartID part.

    Thanks

  8. #8
    Join Date
    May 2006
    Posts
    407
    I really don't want to give up on this, because I think I have seen a really great concept in your design. Could you show us the complete SQL statement for the dynamic drop down box, and give some details as how you want to use it?
    Thanks,

  9. #9
    Join Date
    Apr 2007
    Posts
    13
    Hi, some one else gave me the following code

    SELECT Description, '=' + convert(varchar(20), PartID) as partid
    FROM Part
    ORDER BY Description

    Whilst for some reason it did not like the convert statement, if i remove this and use

    SELECT Description, '=' + (PartID) as partid
    FROM Part
    ORDER BY Description

    it shows a list of Partid as "undefined"

    Any Qlues??

  10. #10
    Join Date
    May 2006
    Posts
    407
    Could you post a sample database that has this table and form in it so I can see what is going on?
    Thanks,

  11. #11
    Join Date
    Oct 2006
    Location
    Maitland NSW Australia
    Posts
    275
    If you use Vic's code
    SELECT Description, "=" & [PartID] AS PartID
    FROM Part
    ORDER BY Description;
    You will get a "circular reference error" as PartID cannot be an alias when it is also a field name.

    The correct code is
    SELECT Description, "=" & [PartID] AS PartIDs
    FROM Part
    ORDER BY Description;

    Allan

  12. #12
    Join Date
    Apr 2007
    Posts
    13
    Hi, with regard to the two codeas abov, neither of them seem to work.

    Anyone know why? and can suggest a code that does?

    Thanks

  13. #13
    Join Date
    May 2006
    Posts
    407
    Could you post a sample database that has this table and form in it so I can see what is going on?
    Thanks,
    I can tell from just the few posts I have seen of Allan Murphy he knows what he is talking about. I also know what I'm talking about. Now, two people that should be able to help you, have, but it is not working. I asked for a sample of what you are dealing with. If you would like to take the time to post that sample, I feel Allen, me, or someone else will be able to spot the problem VERY easily with SEEING the database.
    Thanks,

  14. #14
    Join Date
    Apr 2007
    Posts
    13
    Baisically, Part ID is a primary key and auto number in the part table

    What i wish to do is select this, along with description (string), however, place a "=" sign infront on all the part ID's so it returns

    =1
    =2
    =3

    As opposed to 1,2,3

    Is this possible?, if so, how??
    Thanks

  15. #15
    Join Date
    May 2006
    Posts
    407
    I have requested twice to be able to see the ACTUAL database, or a SAMPLE of the actual database. This would allow me to SEE with my own eyes what the code looks like. You have not even acknowledged that I have asked the question about seeing the database or a sample. But you do continue to ask the exact same question. I DO NOT know the answer. But, with the help of the visual of seeing the database, or a sample database, I think I have a very good chance of help you. Until you can address the issue of posting the database...

Posting Permissions

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