Adding A Row To The Query

Aug 3, 2006

hallo everyone,

i have the following query and i am getting the following output

SELECT Sum(tbl_RFQ_Details_AVOB.[AVOB RFQ]) AS [SumOfAVOB RFQ], tbl_Status.Status
FROM tbl_Status LEFT JOIN tbl_RFQ_Details_AVOB ON tbl_Status.ID = tbl_RFQ_Details_AVOB.Status
GROUP BY tbl_Status.Status, tbl_RFQ_Details_AVOB.Status;


SumOfAVOB RFQStatus
16900110RFQ in Process
12610000Under Review
1200000 Decided
3500000 Terminated
1000000 Terminated Supplier
6000000 Leverage Back
40000000Uncompetitive
500000 RFQ in Preparation


Now i require a new line in addition to this that says that the total value is and the sum of those values must be given.

required output:

SumOfAVOB RFQStatus
16900110RFQ in Process
12610000Under Review
1200000 Decided
3500000 Terminated
1000000 Terminated Supplier
6000000 Leverage Back
40000000Uncompetitive
500000 RFQ in Preparation
totalvalue Total RFQ

How can this be done?

regards,
aravind.s

View Replies


ADVERTISEMENT

Adding Tax To Query

Mar 16, 2006

I have developed a query which adds accumulated costs for each client in my DB, I am having trouble adding the VAT tax which is 17.5% to the query though, I seem to get a lesser total once tax is added which can't be correct.

Here is my query:
SELECT DISTINCT Holiday_Bookings.ClientID, Holiday_Bookings.Booking_Cost, Room_Facilities.FacilityCost, Rooms.[CostPerNight], Rooms![CostPerNight]*Nights_Stayed+Holiday_Bookings!Booking_Cost+Room_ Facilities!FacilityCost AS TotalCost
FROM Room_Facilities INNER JOIN (Hotels INNER JOIN (Holiday_Bookings RIGHT JOIN Rooms ON Holiday_Bookings.ClientID=Rooms.ClientID) ON Hotels.HotelID=Rooms.HotelID) ON Room_Facilities.FacilityID=Rooms.FacilityID;

View 3 Replies View Related

Help Adding Something To This Query

Mar 23, 2006

I have a table called DSERDBA_CASE_STATUS_CHANGE and it contains the following fields:

DSERDBA_CASE_STATUS_CHANGE.STAT_CASE_ID,
DSERDBA_CASE_STATUS_CHANGE.STAT_BEGIN_DATE,
DSERDBA_CASE_STATUS_CHANGE.STAT_END_DATE,
DSERDBA_CASE_STATUS_CHANGE.STAT_FROM_CASE_STATUS,
DSERDBA_CASE_STATUS_CHANGE.STAT_TO_CASE_STATUS,
DSERDBA_CASE_STATUS_CHANGE.STAT_USERID,
DSERDBA_CASE_STATUS_CHANGE.STAT_ACTIVITY_CODE,
DSERDBA_CASE_STATUS_CHANGE.STAT_COMMAND,
DSERDBA_CASE_STATUS_CHANGE.STAT_REASON_CODE

I’m looking to find CASE_ID's where the BEGIN_DATE is greater than 09/30/2005 and less than 10/01/2006 where the CASE_STATUS went from O to C and where the STAT_REASON_CODE does not equal INT27 and I have come up with this query which works fine.

SELECT
DISTINCT
DSERDBA_CASE_STATUS_CHANGE.STAT_CASE_ID,
DSERDBA_CASE_STATUS_CHANGE.STAT_BEGIN_DATE,
DSERDBA_CASE_STATUS_CHANGE.STAT_END_DATE,
DSERDBA_CASE_STATUS_CHANGE.STAT_FROM_CASE_STATUS,
DSERDBA_CASE_STATUS_CHANGE.STAT_TO_CASE_STATUS,
DSERDBA_CASE_STATUS_CHANGE.STAT_ACTIVITY_CODE,
DSERDBA_CASE_STATUS_CHANGE.STAT_COMMAND,
DSERDBA_CASE_STATUS_CHANGE.STAT_REASON_CODE

FROM DSERDBA_CASE_STATUS_CHANGE

WHERE
(((DSERDBA_CASE_STATUS_CHANGE.STAT_BEGIN_DATE)>#9/30/2005# And
(DSERDBA_CASE_STATUS_CHANGE.STAT_BEGIN_DATE)<#10/1/2006#) AND
((DSERDBA_CASE_STATUS_CHANGE.STAT_FROM_CASE_STATUS )="O") AND
((DSERDBA_CASE_STATUS_CHANGE.STAT_TO_CASE_STATUS)="C") AND
((DSERDBA_CASE_STATUS_CHANGE.STAT_REASON_CODE)<>"INT27"));

My problem is that I also want to exclude cases where the case went from CASE_STATUS C to O on the same date that it went from O to C (it closed and reopened on the same day) And I don’t know how to adjust this query to accomplishment this.

Can someone show me how? Thanks

View 1 Replies View Related

Adding Query Fields Together

Nov 10, 2005

My company has a microsoft access table with about 1200 IDs containing names, addresses etc.
Now I want to print this out in an excel sheet because I want to create address stickers, but I want every cell in the excell sheet to add information about the columns in the database together. I might be very unclear, let me demonstrate what I mean:
The Acess file might look like this:
id | name | address
1 | john | Street 01
2 | sara | Street 02

Now I want to have 2 excell cells which contain the information like this:
name_address
name_address

In my example, 2 cells with the following information:

john Street 01
sara Street 02

So I dont want 4 cells, I want to add the information together from 1 Id to 1 cell, but I also want to add linebreaks to it, It must eventually become an address sticker

How can this be done?

View 3 Replies View Related

Need Help Adding Query To Table?

Nov 23, 2005

Hi All,

I am trying to add the infomation from a query and place it in a table so that I can use that data to build a Union Query that plots onto a chart.

Heres what I have:
Dim qDef As DAO.QueryDef
Dim SQL As String

Set qDef = CurrentDb.QueryDefs("QryBaseline")

SELECT tblAudio.AudioID, tblAudio.PatientID, tblAudio.AudioDate, tblAudio.Type, tblAudio.L500, tblAudio.L1k, tblAudio.L2K, tblAudio.L3K, tblAudio.L4K, tblAudio.L6K, tblAudio.L8K, tblAudio.R500, tblAudio.R1k, tblAudio.R2K, tblAudio.R3K, tblAudio.R4K, tblAudio.R6K, tblAudio.R8K
FROM tblAudio
GROUP BY tblAudio.AudioID, tblAudio.PatientID, tblAudio.AudioDate, tblAudio.Type, tblAudio.L500, tblAudio.L1k, tblAudio.L2K, tblAudio.L3K, tblAudio.L4K, tblAudio.L6K, tblAudio.L8K, tblAudio.R500, tblAudio.R1k, tblAudio.R2K, tblAudio.R3K, tblAudio.R4K, tblAudio.R6K, tblAudio.R8K
HAVING (((tblAudio.Type)="BL")) AND (((tblAudio.PatientID)=[Me]![PaiteintID]));

I have a "tblEvaluate" that I want to store the above selected record.

I am not sure whether to add and Delete, OR Edit and Update?

How do I get the above information into the table - "tblEvaluate"?

I know it's simple, I just have a mental block!
Thanks for you help....ENVIVA

View 3 Replies View Related

Adding Values In A Query

Sep 28, 2005

can someone help with this. I have 2 fields in a query

tbl1_nbil = 3
tbl2_nbil = 0

however when I add them using

Bill = [tbl1_nbil] + [tbl2_nbil], I only get a few of the added numbers in the calculated field. In some records it works, but in the majority it does not

It onl seems to add when both fields are greater than zero

tbl1_nbil : tbl2_nbil : Bill
1 : 1 : 2
1 : 0 : 0
2 : 1 : 3
0 : 2 : 0
4 : 0 : 0

View 1 Replies View Related

Adding A Field Name To A Query

Nov 30, 2005

I hope I can ask this question so that it makes sense.

I have a totals query that I'm using to make a Chart. The query works fine but I want to change the look abit. What I'm doing is quering a table looking for the total number of times that there is a check box in a field called PDC RTA and totaling the Hrs as well. The data comes back looking looking like this.
PDC RTA-----Count-----Total Hrs
-1 ---------- 6 -------- 53
0 -----------25 -------- 78

My problem is that when I chart this the -1 and 0 show up at the bottom of the bars on the chart. I would like to rename these to fields on the qry qrid then I can chart the new field names so that it will make sense to the user.

Make sense

Jon

View 2 Replies View Related

Adding Iif To Query Or Table

Mar 15, 2006

Hello folks first post here. I tried reading through the boards to find someone with a similiar question, but not luck yet. I have been working with a basics of Access for about a year. I did take take a bit of programming in college but I don't remember much of it, so I looking for a little help. I can usually Google for answers but I cannot seem to find the write key words this time.

A while back I created a table that tracks employees' data and recently I started working with the insurance data I have gathering for sometime.

It goes something like

Field Name Data Type

SS# Number (primary key)
Insurance $ Number
PPO YES/NO
HMO YES/NO
Self YES/NO
Spouse YESNO
Children YES/NO
Family YES/NO
Dental Self YES/NO
Dental Spouse.......etc.


What I'm trying to do is turn the yes/no's into total dollars for each person. I have done this in Excel but the fields were differnet and I had to use a many, many if.'s or a lookup table(data array)

PPO doesn't = a dollar amount by itself, but PPO + Self = $19.03 or PPO + Self + Dental Self = $23.00. Or the person can just have Dental Spouse = 8.86. Pretty much the people can take a piece and leave another.

"Insurance $" is another field name and is where I am trying to get the total to go.

I was thinking of a lookup table but I don't know how to do that in outside of Excel.

I am thankful for any help or even a nudge in the right direction.

~Profector

View 4 Replies View Related

Adding Comments To An SQL Query

Apr 12, 2006

How can I add comments in an SQL Query mode? ",',?, ; None of these work with text following them.

View 1 Replies View Related

Adding A Combo Box To Query

Aug 2, 2006

Hi,

I'm trying to add a combo box to my query so when I select the item from the combo box it executes my query. I don't know where to begin... Any help??

View 7 Replies View Related

Adding In A Query Problems

Dec 4, 2006

Hi,

I have a problem thats really hurting my head and probably has a simple solutions. Please help!

Basicly, I have a query that adds to fields that are numbers, which works fine but when one of the fields is 0 it doesnt add, it just leaves it blank. I have used the nz function in my first 2 fields as some of them are blanks. My calcuation field is simply like:

[returned]+[loaded]

but I get:

Returned Loaded total
0 2


I tried wrapping the nz around my calculation but that gave me like this:

Returned Loaded total
0 2 02
7 8 78

Help! Why doesnt it add 0 and 2 to make 2?

Any help might save my sanity or computer screen.:mad:

Cheers.

View 2 Replies View Related

Adding 'Autonumber' To Query On The Fly.

Jun 21, 2007

Hi all,
I have this select query that pulls out the last 13 distinct values in in descending order from a table. However in order for me to play with these values I need an ID number and ideally i'd like to do this on the fly rather then do a make table and then use that.
Is there any way of adding a 'autonumber' column to a select query on the fly in so that it can be used as reference ?

Thanks in advance,
Mitch...

View 2 Replies View Related

Adding Quantities In A Query

Sep 7, 2007

I have a field, quantity, which i want to add all the quantities together to show a total. I want to do this using a query as i will use this total for other calculations. When in the query, i have selected "sum" in the totals column in the quantity. What do i need to do extra? I am not getting any results at the moment.

Emily

View 2 Replies View Related

Adding In Query Does Not Work

Nov 29, 2007

Im trying to add fields together in a query (these fields are results churned out by an iif expression), however access just concatenates the fields instead of summing. Access will not allow me to change the format of the original fields either.

Any ideas?

View 3 Replies View Related

Adding Table To Query

Apr 4, 2005

My form is based on a select query. There are 2 combos that filter the data displayed in the form by status and property. All of the data is contained in the same table and the query is looking at just the one table. Clicking a button opens a listbox that contains all of the filtered data and clicking a record in the listbox populates the form with that record and closes the listbox. It works good like this.

When I try to add one field (labor) from a second table to the query with that same field added to my form, as long as there is a value in the labor field in the table then it works. If there is no value for labor then the form returns no records. There are records there but they do not have labor assigned yet. I set a default value for the field on my form - (not assigned yet). The listbox displays the records even though there is nothing in the labor field, but clicking a record in the listbox returns an error of 'no current record'.

Actually I dont even have to add the labor field to the form, just having it in the query mucks up the form. I must need an isnotnull statement in the criteria or something.......


Any ideas what I may be doing wrong?

Thanks!

View 6 Replies View Related

Adding Two Fields On A Query Grid

Oct 16, 2005

trying to add 2 fields

=[field1] + [field2]

works but I want a space between the 2

how do you do that?

jon

View 1 Replies View Related

Adding Sequential Numbering To A Query

Oct 5, 2005

Hi,

Just trying to figure out how I can run a select query on some data I have and how to also include an additional field which has a value counting the number of rows.... eg in the first row there would be the usual results and the new field would have a value of 10001, second row would be 10002, third would be 10003.

I've done some searches for sequential numbering but couldnt find anything so far.

Thanks, j

View 8 Replies View Related

Anyway Of Adding Like A Count Field To A Query Please?

Feb 3, 2006

Is there anyway I can add a sort of count field to my query, for example what I require is the result of my query to include a column which counts the rows in the queries.

For example:

PositionID NumOfVotes Count
5 5 1
6 2 2
etc.

Any advice please?

View 1 Replies View Related

Anyway Of Adding Like A Count Field To A Query Please?

Feb 3, 2006

Is there anyway I can add a sort of count field to my query, for example what I require is the result of my query to include a column which counts the rows in the queries.

For example:

PositionID NumOfVotes Count
5 5 1
6 2 2
etc.

Any advice please?

View 1 Replies View Related

Adding Sequence Number To A Query

Apr 3, 2007

I have a query that captures date values from a table based on a between function that works fine. What I would like to do is associate a sequence number fro each date value returned and either perform a make table or leave it as a select query. If I create a table I know that I aam able to add an autonumber field but the query is executed frequently and performing the addition of the autonumber field is not feesible. Any thoughts how I can generate the sequence number each time the query is executed?

Thanks

View 3 Replies View Related

Adding Values With An Update Query

Aug 13, 2007

Hi folks
I have what I reckon is a complex problem that I need to solve for my warehouse.

We hold replacement parts for the machines we sell. Some parts can be subsititued for others, so where we possible we use these parts to simplify our warehousing. Every day we get a file with demand for each part in and we look to see where we could move this demand to for those parts with a common alternative. When we find one we remove the demand from that part in the database and add it to the demand for the common part.

In operational terms we upload the demand file (.xls) to a table of the following structure
Date_added - Date
Part_number - Text
QTY - number

Thus the table holds daily demand by part. What I would like to do is use a update query to:
a) Identify the parts that have common parts to which they can be moved.
b) Add that demand to that of the common part today.
c) remove it from the original part (set to zero).

Idenitfying the parts and restricting to todays date is not a problem, however the additions and deletions are.

Any suggestions?

Thanks in advance!!

View 1 Replies View Related

Adding A Date Parameter To A Query

Nov 8, 2007

Help...I am new to Access and am trying to get a query completed to run a query on contract end dates. My goal is to be able to run the query on a date such as 10/2007 and have it pull all contract end dates that would term for the month of October, 2007. I have been pulling my hair out trying to build expressions and sifting through my access books to no avail.

Any assistance is greatly appreciated!!!

-Michele

View 1 Replies View Related

Adding New Field To Query And Then Form

Mar 6, 2005

I have created a form from a query. I have then at a later date added a new field to the query. I have returned to the form and attempted to add it to the form but it doesn't show the new field within the control source options. Does anyone know why? Do I really have to start all over again with my form?

Thanks
Just1

View 3 Replies View Related

Queries :: Adding Query Criteria Using VB?

Jul 10, 2015

i have a query name "Query01". I want to add a criteria ">=#1/5/2015#" in the field of "PaymentDate" using VBA.

View 1 Replies View Related

Queries :: Adding Value To Query Output

Dec 12, 2013

I have a field in a query that shows amount of hours a site is covered. This field name is Coverage hours and it changes depending on the number of work days in a month. This part is working correctly but some times additional hours may be requested by the customer.

I want to add a another field to this query that will prompt me if their were any additional covered hours. Then I would have the ability to enter a value and the shown output for this field would be the value entered plus the standard coverage hours in the other field.

I'm not sure how to set up the new field.

View 10 Replies View Related

Queries :: Adding Criteria To A Query

Mar 24, 2014

I have one datatable and i have to list the duplicates from it based on different criterias. It contains invoices, we would like to avoid duplicated payments.I'm struggling with a query. Basically i have a working one, i have to add one more criteria to filter out a couple of rows where the text column is "freight", but anyhow i have tried, it's not working. Without that one line where the not equal is, it's working as it should, when i'm adding that line it ruturns the same as before, but it should give me 108 less lines. The below one is based on an other query result called Duplicates_Rule1.Here is the query:

Code:
SELECT * FROM Duplicates_Rule1
WHERE (((Duplicates_Rule1.BSEG_DocumentNo) In (SELECT [BSEG_DocumentNo] FROM [Duplicates_Rule1] As Tmp
GROUP BY [BSEG_DocumentNo]
HAVING Count(*)=1 ))
AND (Duplicates_Rule1.Check) Is Null)
and (Duplicates_Rule1.BSAK_Text <> "FREIGHT")
ORDER BY Duplicates_Rule1.BSEG_DocumentNo;

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved