Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6808985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:01:34+00:00 2026-05-26T20:01:34+00:00

I have no idea what the following query means as I do not have

  • 0

I have no idea what the following query means as I do not have any exposure to MS Access. I need to convert it into MySQL and I can’t figure out what does the LAST() does

SELECT 
    Containers.Container_No, 
    Max(Containers.LastOfContainer_Date), 
    Max(Containers.LastOfContainer_Time), 
    Last(Containers.LastOfETD), 
    Last(Containers.LastOfContainer_Status), 
    Last(Containers.LastOfPickup_From), 
    Last(Containers.LastOfPickup_To), 
    Last(Containers.LastOfConsignee_Name), 
    Last(Containers.LastOfContract_No), 
    Last(Containers.LastOfSeaLNo) 
FROM 
    Containers 
WHERE 
    Containers.Customer_Name = 'value here"
AND  
    Containers.LastOfContainer_Date >='Date here' 
AND 
    Containers.LastOfContainer_Date <= 'Date here' 
GROUP BY 
    Containers.Container_No

Can some one explain me what does this LAST() actually do?
UPDATE
It seems the query can be changed to following:

SELECT
        Containers.Container_No,
        Max(Containers.LastOfContainer_Date),
        Max(Containers.LastOfContainer_Time),
        Containers.LastOfETD,
        Containers.LastOfContainer_Status,
        Containers.LastOfPickup_From,
        Containers.LastOfPickup_To,
        Containers.LastOfConsignee_Name,
        Containers.LastOfContract_No,
        Containers.LastOfSeaLNo
    FROM
        Containers
    WHERE
        Containers.Customer_Name = '".$customername."'
    AND
        Containers.LastOfContainer_Date >='".$fromdate."'
    AND
        Containers.LastOfContainer_Date <= '".$todate."'
    GROUP BY
        Containers.Container_No
    order by
        Containers.LastOfETD,
        Containers.LastOfContainer_Status,
        Containers.LastOfPickup_From,
        Containers.LastOfPickup_To,
        Containers.LastOfConsignee_Name,
        Containers.LastOfContract_No,
        Containers.LastOfSeaLNo
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:01:35+00:00Added an answer on May 26, 2026 at 8:01 pm

    The Last function returns the last value on a given query, for instance I assume that in the query you are using it would return the data of the last transaction made by that certain customer,
    for instance lets say Mike Jagger bought 2things today, he will have 2 transactions with the same date, if you use the last function you would get the latest information that was inserted.

    ID    | Date |   Product
    1    12/12/2011   socks
    2     12/12/2011   shirt
    
    select  last(product)
    from buys;
    
    it would output : shirt
    

    BTW to emulate this behavior you might want to use

    ORDER BY product DESC LIMIT 1 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Any idea why the following code is not working mysql credentials are correct, have
Do you have any idea, why the following code: public class A { public
I get the following Nhiberante error, but have no idea why: could not execute
Any idea why the following query syntax is wrong: SELECT year, sum(profit) FROM BASEDATA
I have run into a rather weird problem. I have created the following query
I have the following query but i have no idea on how to do
I have no idea why I'm getting this following error: Control cannot fall through
I had the following idea: Say we have a webapp written using django which
I have no idea why this wont work but I have tried the following:
I am getting the following stacktrace and have no idea what I am looking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.