Latest Date

Results 1 to 4 of 4

Thread: Latest Date

  1. #1
    Vidya Guest

    Default Latest Date

    Set rs = conn.Execute("select * from tabname where dept=&#039"&session("dept")&"&#039 and max(DateofPost) order by dept")<BR><BR>How do i get the latest date from a table?<BR><BR>i need to retrieve all details of the latest date entry for a particular dept.

  2. #2
    Franco Guest

    Default RE: Latest Date

    Vidya dude<BR><BR>try:<BR><BR>select * from tabname where dept=&#039"&session("dept")&"&#039 and DateOfPost = max(DateofPost) order by dept<BR><BR>(ie add "DateOfPost = ")<BR><BR>Good luck<BR><BR>Franco

  3. #3
    Vidya Guest

    Default Oops!!! Another Problem

    The error message is that:<BR><BR>[Microsoft][ODBC Microsoft Access Driver] Cannot have aggregate function in WHERE clause (dept=&#039Finance&#039 Or dept=&#039Industry&#039 And DateofPost=max(DateofPost)). <BR><BR>How can i get the latest date??<BR>

  4. #4
    Join Date
    Dec 1969

    Default RE: Oops!!! Another Problem

    SELECT *<BR>FROM tabName WHERE Dateofpost IN<BR> (SELECT MAX(dateofpost)<BR> FROM CallingModule<BR> WHERE dept = &#039"&Session("dept")&"&#039)<BR>order by dept<BR>

Posting Permissions

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