Hi Everyone,
This one is driving me crazy.
I have three tables: purchase_order, purchase_order_ bom, and rog_bom.
The table purchase_order_ bom is a list of parts ordered for the purchase order. The table rog_bom is a list of parts received for the purchase order (ROG stands for receipt of goods).
I want to run a query that looks through table purchase_order but only show the purchase orders that...
Search Result
Collapse
12 results in 0.0015 seconds.
Keywords
Members
Tags
-
Comparing SUM of two tables
-
Left Join in a subquery not working in access 2010
I have a table called people which has a row for each person. Their address is represented by aacode and their number in the house is PERSNO there are then fields which represent the relationships between people. e.g. PERSNO=1 relationship to PERSNO=2
I want to produce a query which return a single row for each house which includes columns for each relationship between PERSNO=1 and the other residents, something like this.
... -
How can I do a "Grouped TOP 1"?
I dont know how to do this, given this table:
What I need to do...Code:----------------------------------- CaseId | User | Timestamp ----------------------------------- 1 | 1 | 01/26/2011 2 | 3 | 03/12/2011 3 | 2 | 03/20/2011 4 | 1 | 04/16/2011 5 | 3 | 05/17/2011 6 | 1 | 05/06/2011 7 | 1 | 08/18/2011
-
SQL query to find covering staff - Syntax error
Hi Everyone,
To my understanding this code should work; however there's a syntax error somewhere within the sub-query and I cannot find it. It's very possible that my understanding is insufficient and there's a better way to achieve my ends, hence a little background on the motivation behind the query:
I run a staffing database for my department. My boss wants a report that can be run to identify which staff members... -
How to work on SQL Subqueries with OleDbDataReader?
Whenever I run the code, I get an exception "No value given for one or more required parameters". I don't find anything wrong with the SQL statement (or are there any?). Basically I'm trying to get the user input and look for the corresponding CourseNumber then match the CourseNumber and TopicNumber. Then I will look up for the TopicName using TopicNumber.
...Code:protected void AddAssignment() { -
How to use a UNION subquery to delete unmatch records?
Hi all - I am trying to create a single sql statement that will delete unmatch recoreds. It is a fairly simple action on the surface, however it involves a subquery that is a UNION. I keep getting errors. Can someone point me in the right direction?. I can create the UNION query, and then create another query that uses the Union query. However, I would really like to combine the two into one SQL statement so it can be placed in VBA without any... -
Subquery to calculate the YTD amount
Hi I am trying to calculate the YTD amount and I keep getting the following error "You tried to execute a query that does note include the specified expression 'Fiscal Year' as part of an aggregate function". Can you offer any assistance?
...Code:SELECT GetFiscalYear([InvoiceDate]) AS [Fiscal Year], fFiscalPeriod([InvoiceDate]) AS Period, DatePart("q",[invoicedate]) AS Quarter, DatePart("m",[invoicedate]) AS [Month], -
Sql Subquery with sum
I have two tables Invoices and Payments. invoices have payments. I want to write a query that displays unpaid invoices and the remaining amount of the invoice, which is calculated by summing up the payments of the invoice and subtracting it from the invoice amount. I tried this query but it doesn't work. please how can i do it.
...Code:SELECT Invoice.[Invoice Date], Invoice.Item, Invoice.Quantity, Invoice.[Unit Price], Invoice.[Payment Status], Invoice.[LongDate],
-
how to get multiple specific values in one row with subqueries
The part...Code:SELECT DISTINCT servicesid,short_name, long_name FROM tg_services WHERE servicesid IN (SELECT DISTINCT service_id FROM tg_srv_links WHERE service_id IN (SELECT DISTINCT service_id FROM tg_srv_links WHERE option_id = 9) AND option_id = 40 AND option_id = 27 AND option_id = 3) AND s_approved=1 AND long_name <> '' ORDER BY `long_name` LIMIT 0, 5
-
Getting Syntax Error whilst applying Totals in Query
I am receiving the following error when attempting to run my query. In my mind - this error should not be happening - its a straight-forward query with a subquery. I am using Access 2003 with all the latest patches.
If I do not group the query (ie. remove aggregation) it will work. If I recall, it also works if my subquery does not have joins.
I want to accomplish this with pure SQL .. I could easily... -
cathycros started a topic How to insert Unicode data into table when pulling data from another tablein SQL ServerHow to insert Unicode data into table when pulling data from another table
Hi,
I'm trying to take data from varchar fields in one table and copy it to Nvarchar fields in another table. (Long story - now dealing with multiple languages, not enough space in row in current table for multiple Nvarchar fields...).
I know how to insert new text into the Nvarchar fields:
but the problem I'm having...Code:INSERT INTO tblNotes ( noteID, note ) SELECT 1, N'This is a unicode note'
-
Left Outer Join with subqueries?
I need to use a left outer join to get all of one table, and match it to specific instances of another table. Eg, report all of A, and where A has made a specific kind of B, report the name of that B.
Now, to get the specific B, I need to join three other relations together, and then do a string match. That's easy. I can report the subset of A that has made specific kind of B. I can report all of A. I can report all of A that has made...