473,699 Members | 2,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Data with Max Qty and Date ?

hi all,

I am really do not know how to get this. Tried all types of queries.
The requirement is as below

itemid maxqty Mdate (date is when the max qty went out)
001 5 5/1/2004
002 2 5/10/2004

The actual table has all transaction data as below.
itemid qty date
001 5 5/1/2004
001 3 5/2/2004
001 3 5/3/2004
001 2 5/4/2004
002 0 5/1/2004
......
002 2 5/10/2004

one query is
select itemid,max(qty) from mTran

with the above require which date it occurred.

Please help

Cap2010
Nov 13 '05 #1
1 1351
You might try this query:

SELECT m1.itemid, m1.qty as maxqty, m1.date as Mdate
FROM mTran AS m1
WHERE m1.qty = (
SELECT Max(m2.qty)
FROM mTran AS m2
WHERE m2.itemid=m1.it emid;
);

"captain" <ca**********@y ahoo.com> wrote in message
news:27******** *************** ***@posting.goo gle.com...
hi all,

I am really do not know how to get this. Tried all types of queries.
The requirement is as below

itemid maxqty Mdate (date is when the max qty went out)
001 5 5/1/2004
002 2 5/10/2004

The actual table has all transaction data as below.
itemid qty date
001 5 5/1/2004
001 3 5/2/2004
001 3 5/3/2004
001 2 5/4/2004
002 0 5/1/2004
.....
002 2 5/10/2004

one query is
select itemid,max(qty) from mTran

with the above require which date it occurred.

Please help

Cap2010

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2456
by: Riegn Man | last post by:
I have a problem with access and our time clocks. We have time clocks that put out a .log file with the badge swipes for everybody. There is one .log file for each day. I am pulling that data into an access database to manipulate it. In the table I have: FIRSTNAME | LASTNAME | BADGE# | DATE | TIME The problem is that the time clock doesn’t differentiate between a “clock in” and a “clock out”. It only records badge...
3
2568
by: captain | last post by:
Below is the sql for data with same date need to extract + or - 5 days data of same date also. How to also get data of + and - days related to same date. SELECT IM.Area, IM.Location, IT.itemid, IT.date,
2
2683
by: Dnna | last post by:
I have a table which is bound to an Internet Explorer XML data island. I'm using ASP.NET's client-side validators for an input field in the table. The problem is that if the input fields are in a table that is bound to the island (such that the rows are dynamically generated by IE from the XML data island), the validators do not work. If the table is not bound, the validators do work, but then I don't have the table iterating through...
0
5658
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable) at System.Data.Common.DbDataAdapter.Update(DataSet dataSet) at TryThis.Form1.save() in C:\Documents and Settings\Nick\My Documents\...
1
2892
by: panche | last post by:
I'm developing a fairly simple user control that has two textboxes for date/time entry (a from date/time and a to date/time). One of my requirements is that there should be no button that sets these values (i.e., no button to cause a postback). The problem I'm having is that I need a number of validations to be performed on the data entry, but I don't know how to do this without having the user control/page posted back to the server. ...
17
3020
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). I have a dataset as follows (1 week to keep it short): Employee 1 - Date 1 Employee 1 - Date 2
17
3548
by: Timothy.Rybak | last post by:
Hello all, This is my first attempt at an application, so kid gloves are appreciated. I need to make a very simple form that only has a few elements. One is TraceCode - a text field that is populated when a user scans a label. The other is ScanDate - a date/time field that should equal the date/time of the scan (e.g. 7/31/2006 5:00:00 AM).
17
2587
by: lokidog | last post by:
I am trying to automatically transfer data from one textbox to another between subforms within a 'main' form. I put this code into the Gotfocus eventprocedure: Private Sub Date_GotFocus() If Len(Trim$(Me!.Value & "")) = 0 Then 'This checks for blank or space-filled date field - it will only transfer data if it has not already been entered. Me! = !!.!.! SendKeys "{F2}" SendKeys "{TAB}"
0
1009
by: mark4asp | last post by:
I have created two DropDownList controls on my form which I want to populate with data from an XML file (stored in the xml subdirectory) Here is the code I use. It does not work. I shows "System.Data.DataRowView" in both the value and text fields of the DropDownLists In debug, I noticed that: ds.Tables.Rows.Count = 20
6
8161
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql server mobile ce database. Until recently I was synching everything thru a com port serial cable. The devices would connect to the computer thru activesync and are able to acquire an internet connection. The sync for the program occurs thru a website...
0
9173
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8911
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8882
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7748
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6533
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.