Results 1 to 2 of 2

Thread: Greatest among the given dates

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2001
    Location
    Chennai, India
    Posts
    219

    Greatest among the given dates

    Dear all,
    I want to get the greatest date (in datetime format) from a table.
    when I try,

    <%
    ....
    rs.open "select max(cr_dt) as ma from prospect",cn
    response.write(rs(0))
    ...
    %>

    The output is 7/4/2001 10:21:27 AM.
    But I have another value 7/4/2001 1:53:10 PM, which is greater than the output value.

    I guess the max() function isnt working properly with the datetime field.

    How should I get the greater datetime from my table

    Cheers and thanx in advance
    Parasuraman
    Om Nama Sivaya!!!

  2. #2
    MarcelB
    Guest
    Okay, I haven't tried thius myself, but why not try something like:

    rs.open "select cr_dt as ma from prospect where not exists (select cr_dt as ma2 from prospect where ma2 > ma)",cn
    response.write(rs(0))


    I think it could work.... right?
    Marcel

Posting Permissions

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



Click Here to Expand Forum to Full Width