|
-
Jul 4th, 2001, 05:39 AM
#1
Thread Starter
Addicted Member
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
-
Jul 4th, 2001, 09:23 AM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|