Substitute Of Last() Of Ms Acces 2000 in Sql Server 2000

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aschauhan18
    New Member
    • Jul 2007
    • 1

    Substitute Of Last() Of Ms Acces 2000 in Sql Server 2000

    Hi

    Does Anybody help me
    Substitute Of Last() Function Of Ms Acces 2000 in Sql Server 2000 .

    This is my query
    -----------------------------------------------------------------------------------------
    Select * from AG_IN_OUT_Local where CARDID='" & StrNo & "' and mdate between '" & DateValue(Date) & "' and '" & DateValue(DateA dd("h", -1, MDate)) & "' AND MOut=(Select Last(MOut) From AG_IN_OUT_Local where CARDID='" & StrNo & "' and mdate between '" & DateValue(Date) & "' and '" & DateValue(DateA dd("h", -1, MDate)) & "')")
    =============== =============== =============== ===========
    this is writtin in Visual basic as frontend here <date> is todays date and
    MDate : is date of in
    MOut : time
    =============== =============== ===========
    plz do me help
  • voroojak
    New Member
    • Feb 2007
    • 92

    #2
    i am not sure but i think u can use max() instear of last().

    Comment

    • achhabra
      New Member
      • Mar 2008
      • 1

      #3
      The same problem I m facing, have u got any solution of the same, if yes thn plz let knw the same,


      Originally posted by aschauhan18
      Hi

      Does Anybody help me
      Substitute Of Last() Function Of Ms Acces 2000 in Sql Server 2000 .

      This is my query
      -----------------------------------------------------------------------------------------
      Select * from AG_IN_OUT_Local where CARDID='" & StrNo & "' and mdate between '" & DateValue(Date) & "' and '" & DateValue(DateA dd("h", -1, MDate)) & "' AND MOut=(Select Last(MOut) From AG_IN_OUT_Local where CARDID='" & StrNo & "' and mdate between '" & DateValue(Date) & "' and '" & DateValue(DateA dd("h", -1, MDate)) & "')")
      =============== =============== =============== ===========
      this is writtin in Visual basic as frontend here <date> is todays date and
      MDate : is date of in
      MOut : time
      =============== =============== ===========
      plz do me help

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        Originally posted by aschauhan18
        Hi

        Does Anybody help me
        Substitute Of Last() Function Of Ms Acces 2000 in Sql Server 2000 .

        This is my query
        -----------------------------------------------------------------------------------------
        Select * from AG_IN_OUT_Local where CARDID='" & StrNo & "' and mdate between '" & DateValue(Date) & "' and '" & DateValue(DateA dd("h", -1, MDate)) & "' AND MOut=(Select Last(MOut) From AG_IN_OUT_Local where CARDID='" & StrNo & "' and mdate between '" & DateValue(Date) & "' and '" & DateValue(DateA dd("h", -1, MDate)) & "')")
        =============== =============== =============== ===========
        this is writtin in Visual basic as frontend here <date> is todays date and
        MDate : is date of in
        MOut : time
        =============== =============== ===========
        plz do me help
        Is it the same as MAX or MIN ?

        -- CK

        Comment

        Working...