Consulting

Results 1 to 4 of 4

Thread: SQL Add a date from another table

  1. #1
    VBAX Regular
    Joined
    May 2015
    Posts
    87
    Location

    SQL Add a date from another table

    SELECT A.FILE_NO, DATE() - 1 AS Yesterday, A.BA_INT_RATE, MAX((SystemDate].[SystemDate]) AS systemDate
    FROM Claim AS A
    WHERE A.STATUS_CODE = "OPN";

    Above is a query in Microsoft Acces 1997 in the part "MAX((SystemDate].[SystemDate]) AS systemDate" I'm wanting to display the most recent systemdate in the systemdate table into a field called systemdate in my query.

    The systemdate table simplay has an index in column 1 and the systemdate in column 2. I can't join the table to the table claim in my query. Is there a way to simply display the most recent systemdate in a field called systemdate in my query?

    If not is there any suggestions on how I could accomplish this?

    Thank you

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,443
    Location
    Does this work for you?

    SELECT A.FILE_NO, DATE() - 1 AS Yesterday, A.BA_INT_RATE, (SELECT MAX(sys.SystemDate) FROM SystemDate AS sys) AS systemDate
    FROM Claim AS A
    WHERE A.STATUS_CODE = "OPN";
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    May 2015
    Posts
    87
    Location
    Quote Originally Posted by xld View Post
    Does this work for you?

    SELECT A.FILE_NO, DATE() - 1 AS Yesterday, A.BA_INT_RATE, (SELECT MAX(sys.SystemDate) FROM SystemDate AS sys) AS systemDate
    FROM Claim AS A
    WHERE A.STATUS_CODE = "OPN";

  4. #4
    VBAX Regular
    Joined
    May 2015
    Posts
    87
    Location
    I just got back to this project, but yes thank you that worked

Posting Permissions

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