Using ORDER BY Clause in an unconventional way

Results 1 to 2 of 2

Thread: Using ORDER BY Clause in an unconventional way

  1. #1
    Join Date
    Dec 1969
    Posts
    112

    Default Using ORDER BY Clause in an unconventional way

    hi<BR>here&#039s my dilemma: I would like to filter records in SQL dbase with an ORDER BY someField in the ascending (ASC) way alphabetically, but such that each day the sort would begin with a different letter. For instance, today with &#039A&#039, tomorrow with &#039B&#039, and so on. Is there an easy way of doing this?<BR>Thanks.

  2. #2
    Join Date
    Dec 1969
    Posts
    511

    Default RE: Using ORDER BY Clause in an unconventional way

    The only way that came to mind would be a select clause like this:<BR><BR>SELECT *<BR>FROM MyTable<BR>WHERE MyField IN (&#039A%&#039,&#039B%&#039,&#039C%&#039,....&#039Z %&#039)<BR>ORDER BY MyField<BR><BR>You would have to use a little bit of ASP to create the list of Letters to check against, but that should not be too much of a problem. I must warn you though that I&#039ve neve used wildcards in a (IN) query before, it should work though, honest ;)<BR><BR>Hope that helps<BR><BR>Pete

Posting Permissions

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