[thelist] SQL Help needed

Kevin Greene sinnot at iol.ie
Thu Jan 31 18:55:00 CST 2002


Hi,

   I have a small problem with a SQL statement.  Basically I have a table with
two datetime fields in it.  They are called "paiduntil" and "lastloggedon".  If
"paiduntil" is not null, I want these results displayed first and sorted by
"lastloggedon", then I want the records where "paiduntil" is null ordered by
"lastloggenon"

  What I have at the moment is

SELECT * FROM TableA
order by paiduntil, lastloggedon

  Obviously the above statement is wrong.  Any help would be appreciated.

Regards,
Kevin





More information about the thelist mailing list