1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Sorting My Form?

Discussion in 'Databases' started by NewfieSarah, Jan 17, 2006.

  1. #1
    Hey all I have a problem I would like to populate my forms with the data from another form, and I know one way of how to do this however, I would like to be able to sort my form data. Since I have filtered my data I only see user 3's reccords not all users on the one form, I would like to have the ability to sort the form by the most current date. Since I already have more forms done, i would like to keep it that way. The fields I have on my form are:
    PIN, PERMIT NUM, DATE, PHONE, PHONEWORK, OWNER, AGENT, CONTRACTOR, DECSCRIPTION, WIDTH, LENGTH, CLASS, DATE ISS, PENDING, HEIGHT, COST, NOTES. . . IN that order! So what I would like to do is put them in order by the date recored ie DATE. so that the most recent date shows up not Actually now just looking at it i think it is sorted by PERMIT NUM, so is there a way to sort by two different things? as well or what? Thanks in advance
    SEMrush
     
    NewfieSarah, Jan 17, 2006 IP
    SEMrush
  2. Gostt

    Gostt Member

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    Sure.. you could do something like:

    SELECT * FROM YourTable ORDER BY DATE DESC, PERMIT NUM ASC

    That would sort your records by date and if some had the same date, it would sort those by the permit #'s.
     
    Gostt, Jan 17, 2006 IP
  3. NewfieSarah

    NewfieSarah Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    So why do you have DATE DESC, PERMIT NUM ASC THERE?
    Is what you are telling me that I can select all fields(*) from my table and order by. date-desc-permit num- in assessending order? Is that correct?? A little more infor please! Thanks
     
    NewfieSarah, Jan 19, 2006 IP
  4. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yes, what he's saying is that you can sort by two seperate fields in this manner. for example, "order by date desc, permit num asc" will look through your order clause left to right, and thus order the results first by date desc (most recent first) and then within like dates from the "date" field, i.e. say you have 5 records for friday, august 24, then it would order those 5 records by permit number asc.
     
    vectorgraphx, Jan 19, 2006 IP