please help with this query

Ost  Ocity   Dstate  Dcity  Carrier  Price  Rank  Diff
A      B          C         D       X        1200    1       100
A      B          C         D      Y        1300    2        100
A      B         C          D       Z        1350    3        100
A     B           C        D        W       1789    4        100
A1    B1         C1      D1      X1          785   1
A1    B1         C1      D1      Y1          789   2
The rank for every carrier  is based on the price .  If  rank1
carrier
is not a pariticular carrier(say if  it is not X1 or
Y1  or Z1), then i want to calculate the difference between  Price
corresponding to rank1 and price corresponding to rank2. and fill the
Diff column with the value. I want a query which can create that
difference coln ( last col) as  in the above example.  The first four
rows is one lane and the last two rows is another lane. For the
second set of lane, the diff col will be empty because tthe carrier is
X1.
Can somebody  please help me in writing this query.

Thanks in advance
0
subs
2/19/2008 6:13:14 PM
access.queries 6343 articles. 1 followers. Follow

1 Replies
500 Views

Similar Articles

[PageSpeed] 0

On Tue, 19 Feb 2008 10:13:14 -0800 (PST), subs <subbu1678@gmail.com> wrote:

>Ost  Ocity   Dstate  Dcity  Carrier  Price  Rank  Diff
>A      B          C         D       X        1200    1       100
>A      B          C         D      Y        1300    2        100
>A      B         C          D       Z        1350    3        100
>A     B           C        D        W       1789    4        100
>A1    B1         C1      D1      X1          785   1
>A1    B1         C1      D1      Y1          789   2
>The rank for every carrier  is based on the price .  If  rank1
>carrier
>is not a pariticular carrier(say if  it is not X1 or
>Y1  or Z1), then i want to calculate the difference between  Price
>corresponding to rank1 and price corresponding to rank2. and fill the
>Diff column with the value. I want a query which can create that
>difference coln ( last col) as  in the above example.  The first four
>rows is one lane and the last two rows is another lane. For the
>second set of lane, the diff col will be empty because tthe carrier is
>X1.
>Can somebody  please help me in writing this query.
>
>Thanks in advance

Subbu, I think the reason nobody has posted a response is that your question
is very difficult to understand. You know what a "lane" is, but we don't. You
know how rank is determined, we don't. You understand how 1789 and 1350 can
produce a Diff of 100, but we don't. You know the special meaning of X1 but we
don't.  Could you explain a bit more about the nature of your data and the
calculations??
-- 
             John W. Vinson [MVP]
0
John
2/19/2008 9:25:06 PM
Reply:

Similar Artilces:

Help Needed ... Probably simple for you gurus ... locking cell after data entered and
positioning next cell after enter is hit I am very computer illiterate and have searched and experimented for 2 days with limited success here is currently what the macro does when data is entered into a cell that cell is filled with the color green....simple...and works also there is 3 different columns with data being entered...A....B....C....after data is entered in C it automatically puts the current date in the corresponding cell in column D....that is somewhat ok...would like it to time stamp it also here is features that I would like to add Once data is entered to a cell I would l...

Help, can't shrink to fit so art prints on 1 page!
Working on a large banner, and want to share it with my team for review. Original file is 15mg, too large to send, and making a .pdf results in 45 pages of tiled images. Other desktop publishing software allows you to select a "fit to one page" or "scale" option so your image is reduced to one legal or letter sized sheet of paper. I can't even print this out to walk around and show my co-workers for comment. So - making a .pdf doesn't work, selecting Reduce then Fit to Paper Size won't work, asking to scale this to 20% won't work, printing to Offic...

HELP! Design Review & Risk Management topics (in ASP projects) required
Hi, I have to take 2 one hour sessions on the following topics: * Project Design Review * Project Risk Management Can you please recommend any topics/examples/case studies for the same? Any help will be much appreciated. On 9/6/2010 8:12 AM, gangestech wrote: > Hi, > > I have to take 2 one hour sessions on the following topics: > > * Project Design Review > * Project Risk Management > > Can you please recommend any topics/examples/case studies for the same? > > Any help will be much appreciated. > <http://www.dofactory.com/Fra...

Pivot Table Help #3
I have a lot of data that I am trying to analyze with a pivot table and am not sure how to go about it. Columns are (1) District (2) Store # (3) 2003 Score - these are #s or text ("incomplete") (4) 2004 Score - these are #s or text ("incomplete") For each district, I am trying to find out 3 things: (1) % of stores incomplete (2) Average score for 2003 & 2004 - I've got this one working properly (3) % change between 2003 & 2004 I can successfully analyze the data in a spreadsheet but there is too much to go through and thought a pivot table was the way to ...

Help! This is serious!
All of a sudden when I try to open an .xls file, it comes up with a page full of little "y"'s. What is wrong? I have data that I need to recover! I hope you have a backup. And keep your backups safe and offline. http://www.mvps.org/dmcritchie/excel/backup.htm Check your font in the fontbox Right click on the sheet tab, view code, anything in there? Tools, Autocorrect check the righthand column for y's Does this happen with just one worksheet, the entire workbook, all workbooks, all MS Office programs like Excel and MS Word. Does it happen on ne...

Help with Dates
Hi all, I have a table with field name "ConnectionDate". I want to create a form with ComboBox that will show the "ConnectionDate" as month and year only. The value the user will choose will be a criteria for a query. Please help. TIA, Tom ?Format(Date,"mmyyyy") would return 112007 so, SELECT Format(ConnectionDate,"mmyyyy") AS ConnectDate FROM SomeTable -- Dave Hargis, Microsoft Access MVP "Tom" wrote: > Hi all, > > I have a table with field name "ConnectionDate". > I want to create a form with ComboBox tha...

Event ID 125
I have received an Event ID 125 on an Exchange 5.5 server. Along with this I have an ID Error #193, 1005 7 and 100 amonst others. Is it possible that during a backup in schedule+ for a client on the client's machine, that the procedure corrupted the EDB.log or any other file? If so, should I be using Microsoft Base Article #275602 to repair. At this point, my Echange server is down. Thanks. Hello Deb Based on the limited information; the 275602 XADM: Microsoft Exchange Server Information Store May Stop After a http://support.microsoft.com/?id=275602 would be a recovery method. Did y...

Help, No pictures in Pub 2003
I installed Pub 2003 and none of my graphics are showing on my document. Does anyone know how I can fix that? Thanks Ed looks left. Ed looks right. No-one is there. Furtively, Ed picks up a note from Xeroid <lnerbonne@cogeco.ca>. On it is written: > I installed Pub 2003 and none of my graphics are showing on my > document. Does anyone know how I can fix that? View > Pictures...? -- Ed Bennett - MVP Microsoft Publisher http://www.mvps.org/the_nerd/ Before reading this message, view the disclaimer: http://mvps.org/the_nerd/disclaim.htm when I open a Pub made file fro...

IFD install needed help
Hi, After facing many errors and difficulties during the CRM 4.0 installation I successfully installed the product. Now I am trying to install CRM as IFD. I want to install IFD without any problems So I have some questions. What is the SDK root domain and web application root domain mean? Is the below config file format is alone enough for IFD installation. Is there anything else i need to look up.?? I went through the MSDN documentation. Can anyone guide tell me how and what configurations i should use to install IFD successfully. <CRMSetup> <Server> <ifdsettin...

Need Help Troubleshooting Report Manager
Here is my situation. I can=92t get to Report Manger via IE. IE just displays the =93Internet Explorer cannot display the webpage=94 error message. Details: OS is Server 2008 Standard. I=92m running a standalone computer =96 not connected to the internet. I=92ve installed MS Loopback Adapter. I=92ve installed SQL Server Reporting Services and it=92s running ok. I verified by going to Services. Status is Started, Startup Type is Automatic. The account I=92m logged in as is a member of the Administrators Group. Windows Firewall is off for all profiles. Under Network Connections ...

Need to remove help compile in project
Can someone tell me how to remove the help build process from a project? Thanks What does this mean? You want to remove part of the build? If yes, just remove those files from project. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "mike" <nospamplease.com> wrote in message news:%236ooDIkGHHA.1468@TK2MSFTNGP04.phx.gbl... > Can someone tell me how to remove the help build process from a project? > Thanks > > I've tried removing the help files but when I build, the help compiler is still invoked. The project show a couple of .rtf files in the dependenc...

HELP with Office 2004 not loading after installing Adobe Acrobat 7.
Hi, Word, Excel and Powerpoint won�t launch anymore after installing Adobe Acrobat 7. I checked on office/startup and the three folders are empty. All I get is window telling me that app couldn�t launch.. Error reporting. Is there a way to fix this? I don�t want to reinstall OSX. I have uninstalled and reinstalled Office several times to no avail. Entourage launches fine. Thanks, AJ There are troubleshooting techniques linked from this page, work through them: http://www.mcgimpsey.com/macoffice/ see General Troubleshooting and Troubleshooting for Office 2004 If they get to the splash sc...

FORMATING COLUMNS..... HELP
I need to format columns to allow only 7 characters and the rest of the data to go into column B -- JTEFUN "JTEFUN" <JTEFUN@discussions.microsoft.com> wrote in message news:6C5C7A99-E83F-430E-9576-6D1DB57B9311@microsoft.com... >I need to format columns to allow only 7 characters and the rest of the >data > to go into column B > -- > JTEFUN > If you mean that if a user types a lot of data into the one cell and that when they reach 7 characters the rest of the data is automatically inserted into the next cell, then I don't think you can do that....

Running Office 2001 on Mac OS 10.2, help
This might be a dumb question, but I don't want to screw things up. I was running Mac OS 9.0.4 and I downloaded OS 9.1, 9.1.2, 9.2.2 and then the new 10.2. However, all my software is still in the 9.1 classic. I want to use it all in the new OS 10.2. Will Office 2001 Academic Edition work in OS 10.2? Do I need to uninstall it in OS 9.1 first, then install it is OS 10.2? Or, can I just drag and drop it on the 10.2 desktop or in the applications folder? I have a lot of other expensive softwares in OS 9.1 that I don't want to have to upgrade, but need to be able to use in OS 10.2. Wi...

Help: message "Requesting data from Exchange Server"
Has anyone figure out why we receive the pop-up message "Requesting data from Exchange Server" when we try to open an email in outlook? We are using Exchange 2000. Is there a parameter we can change to fix this issue? "Kenny" <anonymous@discussions.microsoft.com> wrote: >Has anyone figure out why we receive the pop-up >message "Requesting data from Exchange Server" when we >try to open an email in outlook? We are using Exchange >2000. > >Is there a parameter we can change to fix this issue? Depends to a greater or lesser extent ...

Query and/or 3D Referencing Issue
Hi, I am in trouble and I can't figure out how to do this! I am in Property Management & I have a workbook that is 25 pages of information on residents. Each sheet contains the same type of information but for different tenants. I update these sheets daily. My question is...I want to create a summary sheet (sheet 1) that will pull information from the rest of the workbook. For example, I want to be able to type in "How many move outs from 12-1-05 to 12-31-05" and it pull all of the move outs from the rest of the workbook. I am unsure of how to do this. I am not famili...

Query emails coming to a specific domain
Hello; We have about 5 domains on our exchange server that we receive email from. We are in the process of not renewing one of our domains but would like to check to see if email from that domain is still coming through. Is there any way to do that? I tried the Message Tracking Center with the *.domain.com but it didn't like that. It wanted a specific user. Thanks Check SMTP logs as well. -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: www.exchangepedia.com/blog ---------------------------------------------- <nospam@newsgroup.com> wrote in message news:...

Outlook help
Hello. After years of using Outlook on my Windows XP machine, now I get the following error: Cannot start Microsoft Office Outlook. Unable to open the Outlook window. The set of folders could not be opened. The server is not available. Contact your administrator if this condition persists. Can anyone help? Where is the actual data kept? Can I retrieve it? Can you open Outlook in Safe Mode by using the /Safe switch? If you need help using Outlook command line switches, look here: http://support.microsoft.com/default.aspx?scid=kb;en-us;296192 -- Jocelyn Fiorello MVP - Outlook ...

need help with list box?
Hi I have a huge table of about 20000 records. how can I restrict entry for a few columns. I am new to excel programming. For example. I have a list of colors (red, green, blue) that I want to go under the Color column. how can I allow the user to click on a pulldown or list box similar to ms access for each cell. thanks in advance. Hi you could use 'Data - Validation'. See: http://www.contextures.com/xlDataVal01.html >-----Original Message----- >Hi > >I have a huge table of about 20000 records. how can I restrict entry for a >few columns. >I am new to exc...

Help! Can't Restore my "Old" Money 2005 Backup
Help! Can't Restore my "Old" Money 2005 Backup. Windows 2000 replaced by Windows XP Home on C:\Drive. D:\Drive contains data and Backup only. PC is on a wired Home Network . I recently upgraded from Windows 2000 Pro to Windows XP Home. I wiped the C: Drive clean (formatted) and did a "Fresh" install of Windows XP Home. I reinstalled Microsoft Money 2005 Deluxe, then tried to restore my "old" 2005 Money Backup file (My Money Backup.mbf) from both D: Drive and USB thumbdrive. The Restore shows a default location ..."C:\Program Files \My Money.mny&quo...

Pls help me out.
Greetings to all. i am a new Mac user. i inherited a ibook loaded with MsOffice for Mac that is in german. do you think i can reset the language to english without having to re-install the whole sofware? if so, how? thank you all so much! On 10/5/04 4:16 PM, in article 2ee7bd29.0410042316.72004f36@posting.google.com, "luc" <tchinlai@yahoo.com> wrote: > Greetings to all. > > i am a new Mac user. i inherited a ibook loaded with MsOffice for Mac > that is in german. > do you think i can reset the language to english without having to > re-install the whole s...

Query TableName stored in another table
History: Currently I have an sProc that returns a row of data for my data entry process, first retrieving the tablename then querying it; however I'm now writing a webpage admin UI for near-novice users and will not be exposing the sProc as it would take too much to explain how to write new ones when a new view would be setup in the admin UI... so... Objective: Is there a way to retrive a tablename field and query the named table at the same time, something like... select top 1 * from (select tablename from mailings where code = mailCode) ...

immediate help
on close of a workbook a cell value should be written to another workbook Why is your request so much more important than all of the others? -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "sak" <sak@discussions.microsoft.com> wrote in message news:95549E21-720E-4631-B124-E62A5A44061E@microsoft.com... > on close of a workbook a cell value should be written to another workbook How about linking that cell in the other workbook to the cell in the workbook that you are about to close, that way it's always current in that other workbook...

Save static data from web query
I have a worksheet with a web query. The sheet is accessed over the internet and the web query loads it with data. Is there a way for the user to save the worksheet together with the data rather than save it with the query itself? Once the sheet is loaded with data I want to save it containing static data and no web query... /Patrik ...

Major instal issue
I have Money 2002 installed, and have had for some time. About two weeks ago, I started getting the Windows Installer "preparing to install" message repeatedly when I open Money, or when the Money Viewer is invoked in IE. Both Money and the viewer work fine, but no matter if I cancel or ignore the message, it keeps coming up roughly once every two seconds. The real issue though is this: since this started happening, I've been unable to install or uninstall anything else that uses the Windows installer (including trying to uninstall Money to solve the issue), as it fails saying t...