Professional Web Applications Themes

Order Query Results by date - Macromedia ColdFusion

I am pulling records from an Access database and trying to order by the date. However, CF seems to be ordering the dates by the math value (i.e. 3/10/2005 = 1.4X10-4 and so it comes before 3/1/2005 which = .00149) I have tries switching the field type from date/time to text and that didn't work. Below are the queries I have tried. Thanks for help SELECT Aloneguests.last_name, aloneguests.first_name, aloneguests.guest_number, ddate, seen_statusAM, seen_statusPM, seen_byAM, seen_byPM, stay.room_number, aloneguests.comments FROM aloneguests INNER JOIN stay ON stay.guest_number = aloneguests.guest_number WHERE stay.checkedin = yes AND aloneguests.guest_number = #session.guest_number# ORDER BY aloneguest.ddate ASC SELECT Aloneguests.last_name, aloneguests.first_name, ...

  1. #1

    Default Order Query Results by date

    I am pulling records from an Access database and trying to order by the date.
    However, CF seems to be ordering the dates by the math value (i.e. 3/10/2005 =
    1.4X10-4 and so it comes before 3/1/2005 which = .00149) I have tries
    switching the field type from date/time to text and that didn't work. Below
    are the queries I have tried. Thanks for help

    SELECT Aloneguests.last_name, aloneguests.first_name,
    aloneguests.guest_number, ddate, seen_statusAM, seen_statusPM, seen_byAM,
    seen_byPM, stay.room_number, aloneguests.comments
    FROM aloneguests
    INNER JOIN stay
    ON stay.guest_number = aloneguests.guest_number
    WHERE stay.checkedin = yes AND aloneguests.guest_number =
    #session.guest_number#
    ORDER BY aloneguest.ddate ASC


    SELECT Aloneguests.last_name, aloneguests.first_name,
    aloneguests.guest_number, ddate, seen_statusAM, seen_statusPM, seen_byAM,
    seen_byPM, stay.room_number, aloneguests.comments
    FROM aloneguests
    INNER JOIN stay
    ON stay.guest_number = aloneguests.guest_number
    WHERE stay.checkedin = yes AND aloneguests.guest_number =
    #session.guest_number#
    ORDER BY 'aloneguests.ddate'



    Tulsa Guest

  2. #2

    Default Re: Order Query Results by date

    Nevermind, sorry to bother. This works fine

    ORDER BY day(aloneguests.ddate)
    Tulsa Guest

Similar Threads

  1. date query problem, date in variable
    By roy in forum MySQL
    Replies: 1
    Last Post: October 16th, 11:57 AM
  2. Complex join = no results (for a query that shouldreturn results)
    By jchapman16 in forum Coldfusion Database Access
    Replies: 4
    Last Post: August 23rd, 10:49 PM
  3. Query results don't display properly in results table.IGNORE PREVIOUS
    By JoyRose in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: March 24th, 07:28 PM
  4. Query results don't display properly in results table.
    By JoyRose in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: March 24th, 07:17 PM
  5. [PHP] unexpected date results
    By Martin Towell in forum PHP Development
    Replies: 3
    Last Post: August 21st, 10:15 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139