select for last record for each customer

I have table with many recodrs as this table:
customerID      Date           Stock1  Stock2  Stock3  Stock4
112105222   22/01/2006        5            6           2          1
112105222   23/05/2006        4            8           6          7
112105222   01/02/2007        6            9           4          6
112101024   12/12/2007        7            8           9          1
112101024   15/02/2007        7            9           2          1
       .                 .
       .                 .
       .                 .

by select qury I want show just the last record for each customerID as this
table

customerID      Date           Stock1  Stock2  Stock3  Stock4
112105222    01/02/2007        6            9         4           6
112101024    15/02/2007        7            9         2           1

Plz who is can help me in select qury 

thanx

0
zmsaadeh
2/24/2007 7:23:50 AM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
784 Views

Similar Articles

[PageSpeed] 26

See:
    Getting a related field from a GroupBy (total) query
at:
    http://www.mvps.org/access/queries/qry0020.htm
for 4 solutions.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"zmsaadeh" <u32014@uwe> wrote in message
news:6e45ef22a2ea7@uwe...
>I have table with many recodrs as this table:
> customerID      Date           Stock1  Stock2  Stock3  Stock4
> 112105222   22/01/2006        5            6           2          1
> 112105222   23/05/2006        4            8           6          7
> 112105222   01/02/2007        6            9           4          6
> 112101024   12/12/2007        7            8           9          1
> 112101024   15/02/2007        7            9           2          1
>       .                 .
>       .                 .
>       .                 .
>
> by select qury I want show just the last record for each customerID as 
> this
> table
>
> customerID      Date           Stock1  Stock2  Stock3  Stock4
> 112105222    01/02/2007        6            9         4           6
> 112101024    15/02/2007        7            9         2           1
>
> Plz who is can help me in select qury
>
> thanx
> 

0
Allen
2/24/2007 7:40:12 AM
Reply:

Similar Artilces:

Customize Appointment Form
I have customized an appointment form however there are two things I have been unable to do... 1. After the fields are filled in I wish to append via VBA two user defined fields to the system field "Location" 2. Is it possible to configure Outlook to show other fields in the calendar when the Appointment window is saved and closed? ...

Combo box list selection based on earlier selection by user
HI, I have a form that has a combo box 1 (Product) that reads a the Product table and has a unique id attached to each product (RO#). There is a second combo box 2 that is RO#. Now what I would like to do is when a user selects a Product in combo box 1, the system should lookup the Product selected from combo box 1 and upload the corresponding RO# in the combo box 2 list. Now I am using both combo boxes as Unbound and in the combo box 2 I have the two columns Product and RO# - in the Criteria row of RO# I have the following: Like IIf([Forms]![xa_f_lookup]![RO#]=" ",[Forms]![x...

Run report on multi selected records.
I try to make a report for a custom entity that works like the Account Summary: let's say that it's Customer's Inquiry Summary for entity Customer's Inquiry I made the report so that I'm able to run the report on Customer's Inquiry Form. But when I select multi records in the list of Customer's Inquiry and run report, only one record is show in one page of the the report. I would like to have the selected records appear in the report with each record on each page. How can I do this? ...

How do I add the Last Date Revised in an Excel spreadsheet?
When I add the date, it changes each time I print. How can I add the last date revised in an Excel spreadsheet? Hi either enter this manually or you need VBA for inserting this date in an event provcedure -- Regards Frank Kabel Frankfurt, Germany "GrlNexDor329" <GrlNexDor329@discussions.microsoft.com> schrieb im Newsbeitrag news:5656928E-520E-4E0D-B17E-FF423BDBCF00@microsoft.com... > When I add the date, it changes each time I print. How can I add the last > date revised in an Excel spreadsheet? See Ron de Bruin's site for code. http://www.rondebruin.nl/print...

Count uniq records and assign to a control
SID is the field of underline query of a form (have many duplicates). I want to count number of uniq SID and assign the result to TotalStudent control on the form. Please help. Thanks - Song In article <e90AFyUbHHA.1388@TK2MSFTNGP05.phx.gbl>, csitnnn@hotmail.com says... > SID is the field of underline query of a form (have many duplicates). I want > to count number of uniq SID and assign the result to TotalStudent control on > the form. Please help. Thanks > > - Song > > > Maybe with a saved query such as Query1: SELECT DISTINCT SID FROM UnderlyingQ...

Set Records Per Page Default
Hi, I'm new to CRM (version 4.0) and have been asked by the boss if it is possible to default the "records per page" option to 250 for all new users rather than the usual 50. I've been through three books now (Microsoft Dynamics CRM 4 for Dummies, Step by Step Microsoft Dynamics CRM 4.0 and Working with Microsoft Dynamics CRM 4.0) and while they all mention that 50 is the default, none of them mentions a way of changing that. Does anyone here know of a way of changing the default? Thanks, Tony. As far as I know there is no default setting for all users. -- htt...

Using Custom Views
Complete Excel noob here - If I've defined a custom view in one workbook, how can I apply it to another. It is not shown in the list. What I want to do: I have a workbook with columnar data similar to a check register. I have set up the formatting for display and print formatting, including headers & footers. This data is for a specific client but I want to save that formatting, both visual and print so that I can create new workbooks for other clients and apply the same formatting. I thought that by saving the custom view it would work but it is not seen outside of the workbo...

Can't select objects in Excel 2007
I'm trying to create a form in Excel 2007, and although I can manipulate, copy & paste controls (check boxes, etc) I can't select multiple objects to align them, etc. I've checked on-line help (and have followed the instructions), and other websites, but no one seems to have indicated a problem. It is extremely cumbersome and I need a solution. Any ideas? Thanks in advance, Jim Berglund I know this is about a year too late, but it may help others who have stumbled across this page looking for similar help. On the Home tab, in the Editing group, click Find & Select....

Lot Selection not Showing when I select PO on Receiving Entry
Usually, the Lot selection screen would pop up when I select a PO at the Line Detail of the Receivings Entry, now it does not! And GP will let items post without a lot number! It seems as if a setting has changed. Any ideas anyone? Any help is appreciated. Thanks, R Are you sure the item is marked to track lots? This wiould be set item by item on the Item Maintenance Options window. -- Richard L. Whaley Author / Consultant / MVP 2006-2008 Documentation for Software Users Get our Free Tips and Tricks Newsletter and check out our books at http://www.AccoladePublications.com &q...

MS Access Customizing an Auto Number
Hi - I would like to create my own auto number. It should include: project acronym+date+#### Example: 65947WHB-CAE_042210-0001 I have a table set up that I can pull the project acronym from, the date would be the date entered into the database, the number would generate automatically. What is the best way to do this? Thanks for your help. April On Thu, 22 Apr 2010 14:08:03 -0700, April Klein <April Klein@discussions.microsoft.com> wrote: >Hi - > >I would like to create my own auto number. It should include: > >project acronym+date+###...

Find last match in vllokup
In Excel2000, I have the following data: Tom 100 Pete 200 Joe 300 Tom 500 I want to have a Vlookup that finds "Tom' and gives me 500 NOT 100. I know vlookups usually finds the first instance of a match but I want the last ( there could be 5 or 4 or 3 records of Tom). Can this be done? Thanks One way: Take a look at the answer to your previous, nearly identical question... Use CountIf() to determine the number of the instance to return. In article <1115238682.523494.108050@o13g2000cwo.googlegroups.com>, "snax500" <gottschalk@world...

Import CSV file and add data to records
I've seperated my three questions to keep this organized. Basically I am importing a CSV file using an open dialog box..... Now, my already existing table has 5 fields, and my CSV file has 4 fields. Before the data is imported, is there a way to create a popup window asking the user to enter the date that the CSV file was generated and use that date as the fifth field for all of the new records being added from the CSV file? I hope I explained this question the right way. Please let me know if it isnt clear. if you want reliable ETL then you shoudl move to SQL Server and use DTS or BCP...

Select contact then hangs
Hi, please help. I have a user that when she selects a contact using To: in a new email, after selecting 2, it closes outlook??. Spec is W2kSP4\office2k with all windows updates and office updates installed. Profile has been deleted and re-created, plus i have set up personal folders and moved contacts into there, and set that folder as a default, but makes no difference. Please help. ...

custom command
How can I get the paste special "Paste Formulas" as a separate command on the Toolbar similar to "Paste Formats" and "Paste Values" ...

Selecting rows from various sheets
Hi all, I have several sheets with a few columns in each. One colum in each sheet has a unique value. Most of these unique values are th same in each sheet but not all. Is there any way that I can set up new sheet that will have the unique value in column 1 and th corresponding column values frommeach sheet beside it. For example Sheet 1 aa 1 1 1 bb 2 2 2 cc 3 3 3 Sheet 2 aa 4 4 cc 5 5 Result aa 1 1 1 4 4 bb 2 2 2 cc 3 3 3 5 5 Thanks alot, Sha -- sha ----------------------------------------------------------------------- shav's Profile: http...

Have Stores Create Records in HQ
Is it possible to have the stores databasse create records in the HQ dbase and not the other way around? For eg. Sometimes clients forget when they get new products to create it in HQ then send out to stores. Merci We have a utility to allow you to create an item simultaneousely at store and in HQ. Contact m efor more detail. Afshin Alikhani - [afshin@retailrealm.co.uk] CEO - Retail Realm "SIDSolutions" wrote: > Is it possible to have the stores databasse create records in the HQ dbase > and not the other way around? For eg. Sometimes clients forget when they get &g...

select text in Calendar
I'm working on a calendar in Publisher. I'm adding text into a cell by spacing down 1 point, then typing in 8 points. Doing fine until April. At that time, I can only select cells (whole days). It will not let me select the text. Help is no help. Any hints out there. Did I accidentally select something to do this? Bonnie Have you added a picture to the cell or a shape? If you have send it to the back, make the cell no fill and try again. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "GoBonnieGo" <GoB...

programatically insert record
I have a many to many relationship between security clearances and billets. a clearance can be associated with more than one billet and a single billet can be associated with many clearances. That; however, may not have anything to do with my problem. I've built a form that has a listbox that displays the assocaited billets for an employee's clearance. Next to it I put a drop down list box that looks up the list of billets and stores it's value for later use. I've then added an "add" button underneath the drop down list box. What i'd like to do is cho...

macro to filter data based on selected data
Hi, I am looking for a macro that requests input of a reference code and then a date and then filters the data in my spreadsheet based on this criteria. I am using excel 2007. Any help with this will be greatly appreciated. You can probably record a macro while doing it manually and then clean it up and add input boxes to ask the question or input your variable in a cell and use that. If all else fails, If desired, send your file to my address below. I will only look if: 1. You send a copy of this message on an inserted sheet 2. You give me the newsgroup and the ...

Custom Data on Receipts
Hi, I'm not sure if this is possible, but does anyone know of a way to display data from a custom table on a receipt? Thanks dave The custom data would need to be set to the Session.Variable(1-10) before PrintReceipt Hook is called. You can use a DLL addon to set your custom data. You need to be careful that no other addon is using the same variables. If the data is static then you can just modify the receipt and hard code the information into the body. Rob "Dave" <Dave@discussions.microsoft.com> wrote in message news:261BCAF0-E737-48CB-B46B-100E00A0AA00@microso...

Creating a way to attach files in custom entity?
I'm looking for a way to be able to attach files to a custom entity in CRM v3. My client originally wanted to be able to have some sort of document repository in CRM, so that users can easily refer back to program docs and then email them to customers. We tried renaming the Sales Literature entity to Program Documents, because you can attach files to those records, but you can't send email from there. Then I thought maybe we could stick the docs in the Knoweledge Base, but every article is based on a template, and they simply want to attach what they already have to CRM and...

Link select with a blast
I have Win 7 Home Premium, x64. Quite often, when I select a link, a mouse pointer changes to a palm with a blast. I understand, the palm is the standard mouse pointer for link select, but what is the blast? What it indicates? -- Ilya Zeldes Fort Myers, Florida Hi Ilya, I suspect that this is being caused by a tracking program. Run something like Ad-Aware and see if it indicates a tracking company. If so, you can delete it, however, it might prevent you from accessing that particular website. Dave "Ilya Zeldes" wrote in message news:7A6FF9B1-5512-44...

Deleting duplicate records 01-21-10
I populated a table using an Append query. I created a duplicate records query using the Wizard. There are 20000 records. Now I need to delete the duplicates out of this query. How do I do that? this may be a duplicate post, im not seeing my first one. anyways, instead of deleting those duplicate records, lets just grab all the records that are not duplicates. (an unmatched query). do a LEFT JOIN from your main table to your duplicate table/query on primary keys. Choose your primary key from the DUPLICATE table, and set the criteria to Is Null. This will pull ALL Recor...

remove last word
How can we delete the last word in a cell from a whole column? Hi dk do you want to do that by formula or by programming? cheers Carlo On Jan 11, 9:40=A0am, dk <d...@discussions.microsoft.com> wrote: > How can we delete the last word in a cell from a whole column? the easiest possible "carlo" wrote: > Hi dk > > do you want to do that by formula or by programming? > > cheers > Carlo > > On Jan 11, 9:40 am, dk <d...@discussions.microsoft.com> wrote: > > How can we delete the last word in a cell from a whole column? > > &q...

No customer record exists for this customer ID
This message came up during the posting process. Why did SOP allow the invoice to be created? A few questions: 1. Does the Customer ID actually exist? 2. Is there a possibility that the customer record was physically removed, say with a T-SQL DELETE statement *after* the SOP transaction record was created? 3. Is there a possibility that the customer's Customer ID was accidentally updated with a T-SQL UPDATE statement *after* the SOP transaction record was created? If the customer record is missing, I would restore the last known good backup into a test environment, then transfer ...