ACCESS - Easy QUERY (Help)
Dec 28, 2006
HI,
I have the next 3 tables,
*************************************************
Table USER: id_user (primary key)
name
Rec: id_user, name
------------------
rec: 1, A
rec: 2, B
rec: 3, C
*************************************************
Table AP : id_ap (primary key)
nr_ap (primary key)
id_user
id_sort
Rec: id_ap, nr_ap, id_user, id_sort
-------------------------------------
rec: 1, 2, 1, 1
rec: 2, 5, 2, 1
rec: 3, 1, 3, 1
rec: 4, 3, 1, 2
rec: 5, 4, 2, 2
rec: 6, 3, 3, 2
NOTE:
SELECT sum(nr_ap) AS Total FROM AP
with id_sort = 1 -> SUM(nr_ap) = 2+5+1 = 8
with id_sort = 2 -> SUM(nr_ap) = 3+4+3 = 10
*************************************************
Table SORT: id_sort (primary key)
value
Rec: id_sort, value
------------------
rec: 1, 80
rec: 2, 200
**********************************************
I need do create a QUERY that for all records in SORT table, it will
show only for user 'A', the rescords as in the result shown below.
NOTE: xxxx = (valueSUM(nr_ap))*nr_ap
RESULT EXPECTED
------------------
id_sort, name, ap, value, xxxx
1 A 2 80 20 (808)*2 = 20
2 A 3 200 60 (20010)*3 = 60
Regards,
Elio
View Replies
ADVERTISEMENT
Aug 10, 2005
I have used Excel for many years and used the if formula. I have just started using access and need a little help. I have a table the has 20 fields. I am only concerned with about 8 of these fields for a report. I have a field named completed in this field I put a "x" if the job is complete. I would like to create a report that shows me all active jobs. Everything that does not have an "x" in complete field. Can somebody either direct my to the forums I should be in or possible give me the correct coding. Thanks for your help in advance.
View 8 Replies
View Related
Nov 6, 2004
ms access
I have a empty table called ...'Table2' with 3 fields 'firstname', 'lastname', 'value'
i have another table called ...'Table1' with 2 fields 'firstname', 'lastname'
i have form with a textbox callled Text0
this is the query that i am having trouble with:
INSERT INTO Table2 SELECT Table1.firstname, Table1.lastname, Forms!Form1!Text0.text FROM Table1;
the query doesnot run, gives an error. The SELECT query works stand alone but not when in above.
P.S someone will ask me if the form was open and had a value and that it was open before the query was run...and the answer is yes
View 2 Replies
View Related
Sep 28, 2004
Hello, this is probably an easy question to most of you but I've only ever designed a couple of simple databases so I've never came accross this problem.
In my database I have several forms viewable using tabs, The main form is tab 1 (client details), tab 2 is marketing information and tab 3 is booking information. Data on tabs 1 and 2 are linked to Client details using the client name. I tested with a sample record and everything was working fine. I have now started inputing all the client details into the client details form (currently entered 200 records) however when I closed the database and re-opened later only one record was showing in the client details form. I though all of the data had been lost but when I looked at the client details table all the data was still there. Why are all of the records not appearing in the form.
I hope you can help and thanks in advance.
Julie
View 1 Replies
View Related
Jan 24, 2008
If you build a DB in Access 2007, can it be operated in earlier versions?
View 3 Replies
View Related
Feb 9, 2006
I have a project in which i have to make a database. Its nothing real complex it has to have 3 tables.
heres my idea
An address book database.... "I know how orignal lol"
anyways here is what i have.... Looking to get my primary keys and forign keys established
tblAddress
AddressID "Pri Key"
First
Last
Address
City
State
Postal Code
tblContact
Email
HomePhone
CellPhone
DateLastTalked
DateUpdated
tblPersonal
Nickname
Birthday
College "Yes or No"
If Yes Where
Hobbies
So I need to get 3 FK keys and 2 more primary keys... This isnt jumping out at me as to what i should use.
View 3 Replies
View Related
Dec 10, 2004
I have a table in Access that has many columns in it. Two columns are in question, one is social security numbers and another is a image file name column that needs image file names in it. The pictures are named with a social security number of the person Ex. 123456789.jpg. I have about 1000 rows of SSN's and need to place the image file names SSN.jpg in the image column. If I copy and paste the SSN column to the image column it is missing the .jpg, is there a way to do this other than manually? And also set it up so in the future the image column is automatically updated when a SSN is typed in.
thanks
View 1 Replies
View Related
Aug 8, 2006
Im just starting to use access for a small business. Im fluent in visual basic but i cannot seem to get this to work. so im using the wizard for the "Order Entry" and it works great. However, on the Preview Invoice where you can also print it, i would like it to include the credit card number, payment method, experiation date, ect. which all can be found on the payment form for the order. I have a text box but i cannot seem to get the write content source. what would be the content source so it can access the payment details from the other form and print it along with the invoice.
View 1 Replies
View Related
Jun 27, 2005
Hey i need some one that knows Access to help with a work Database, and just make sure everything is working and set properly.
This is for a Construction Managment Company.
Email me at *email removed* for more info, and i can send out the DB to be looked at.
Thanks
Kevin Maguire
President
GOT LOCAL MUSIC
View 1 Replies
View Related
Oct 16, 2007
Hello
I'm a beginner when it comes to Access. Right now I'm trying to create a movie database and need help.
I want to be able to search for a title that contains a specific word. For example, I have a movie called "the cube", right now i can only find the movie by typing the full or a part of the correct sequence of the title. For example I can find the movie when typing "the" or "the cube" but not when typing only "cube". This is my problem.
Right now my query looks like this:
SELECT Movies.Title
FROM Movies
WHERE Movies.Title Like Forms!frm_search_title!search & "*";
Please help.
View 2 Replies
View Related
Aug 29, 2006
G'day all,
I'm a novice to Access. I'm trying to setup an adhoc query, whereby a user can select all the records for a particular month.
I've tried using ([month]) in the criteria row but I get an error message??? :confused: :confused:
View 4 Replies
View Related
Feb 21, 2008
I've posted this on another forum, but I'm not getting any help on it. Let me know if I need to explain it in more detail.
I have one table containing a list of addresses:
Address
1301 Main St.
I have another table containing names :
Name 1
John
I have yet another table containing names:
Name 2
Chris
The primary key for the address table matches up with the primary keys in the name tables. I need to write a query that will pair the addresses in the address table with the names from each of the name tables. It should look like this:
Address..................Name
1301 Main St. .........John
1301 Main St. .........Chris
Can anyone help? Thanks.
View 2 Replies
View Related
Apr 20, 2005
I have a table with 8000 records. Now i have two fields (last name) and(ID). Now i want to see all the people that have different ids and that only???
ex
smith 10001
smith 10002
smith 10003
extc
example please
View 1 Replies
View Related
May 4, 2005
I am doing a cert. III in business admin that finishes on MOnday 9 May 2005. I have 3 days to do a mammoth business trip assignment, AND pass a test on Access. The school is a little dodgy and didn't make me do that practical assignment - they gave me multiple choice q's and written q's to take home.
PLEASE HELP!!! I need to pass this course - and we never use Access at work.
Q1. What is wrong with this formula?
=Iff([Product]=Home,1,0)
I'm sure there's more wrong with it than the 'Iff' - that's meant to be 'IIf' isn't it? I've only ever used formulas in Excel..
Q2. What result will the 'Is Null' expression return?
Q3. What is the difference between a Combo Box and a List Box?
Q4. Why is the purpose of the Paste Append function?
Q5. Which formula is correct?
a. =[Qty]*[Price]+[Freight]
b. =[(Qty)*(Price)+(Freight)]
c. =([Qty]*[Price])+[Freight]
d. =[(Qty)*(Price)]+(Freight)
???
Q6. A chart can be placed on:
a. Table view only
b. A form or Report view
c. A Query or Table view only
d. A Report view only
Please answer any of these questions you can - the last one I can trial by error later tonight.
Thanks in advance.
View 4 Replies
View Related
Jun 14, 2004
Hi,
I don't know how to create a simple query that will compare 2 tables and create a new one after that.
Each table has only one field.
Example:
Table 1 has records A, B, C, D and E
Table 2 has records A and C
I want new table to be like table 1 minus table 2. Like cleaning up table 1.
New table would have records B, D and E
I think it's very simple but I can figure how to do it.
Could you pls give me advice?
Thanks a lot,
skuba
View 3 Replies
View Related
Jun 13, 2007
Is there a relatively easy way to output the results of a query to an XML file?
I have the file writer set up more or less:
Code: Dim intFn As Integer Dim strFilePath As String Dim strOutBuf As String strFilePath = "c: emp est.xml" intFn = FreeFile Open strFilePath For Binary Access Write As #intFn strOutBuf = "<?xml version=" & Chr(34) & "1.0" & Chr(34) & " standalone=" _ & Chr(34) & "yes" & Chr(34) & "?>" & vbCrLf strOutBuf = strOutBuf & "<file>" & vbCrLf 'DO FOR EACH LOOP HERE strOutBuf = strOutBuf & "</file>" Put #intFn, , strOutBuf Close #intFn
If this were a C or JAVA application, I would just write a "for each" statement similar to as follows:
Code:For Each (Row in Query){ strOutBuf = strOutBuf & "<entry>" & vbCrLf For Each (Field in Row){ strOutBuf = strOutBuf & "<" & (Column Name) & ">" & (Value) _ & "</" & (Column Name) + ">" & vbCrLf } strOutBuf = strOutBuf & "</entry>" & vbCrLf}
What commands would I use in Access to get each separate row in a query? And then to get each field in that row? And how about the column names for the XML tags?
Thank you for your help.
View 4 Replies
View Related
Dec 27, 2005
Hi all
I'm currently working through developing my first database.
Basically, what I would like is for a query to run from a command button.
The query should look at a field in a table (a yes/no field) and report back the ones that have been filled in.
I know how to run the query from the access 'Query' window, BUT, I would like this query to run from a click of a command button on a form.
I've looked it up in a book, which explains about SQL, and didn't really understand it. I've also searched on here, but people talk about Macro's, and I don't know anything about them.
Can anyone help?
Cheers
View 2 Replies
View Related
Jun 1, 2005
I want to have code that disables fields based on the value of the contents of one of the fields. I wrote this code which goes on and on but it doesn't work. Can someone help?
Private Sub Form_Open(Cancel As Integer)
Dim Item_Number As String
If Me.Item_Number = "300123C" Then
Me.Batch_Lot_Number.Enabled = False
Me.Issue_Date.Enabled = False
Me.Production_to_BPT.Enabled = True
Elseif blah blah blah
else blah
Endif
End sub
View 3 Replies
View Related
Mar 22, 2005
I don't normally work in access so I am sure I am asking a really easy question.
I have a table that is connected to a form where users enter survey data. Currently they have a drop down form to mark the responses to the survey as "Fully Completed", "Partly Completed", etc.
On the table I want to add the text "Awaiting Completion" to all those without any entry so that we can find out how many are left to do.
I can filter the table to give me the correct records, and assumed I could paste the text directly into the column (as with Excel).
Can anyone please let me know how to update the column easily.
Thanks for your advice.
Chris
View 2 Replies
View Related
Mar 30, 2006
Warning - Complete newbie post!
Hi all,
I have 2 Access databases setup, each containing 1 table. Let's call them A and B. These two tables contain some of the same fields.
Table A is used for collecting new client registration info through our website and gets updated by SQL.
Table B is on a different server and is used for company newsletter mailings.
Table A is the one which is automatically being updated so I don't need to do anything with that table. Also, some fields in Table A are auto-incrementing numbers so we can differentiate a clients interest and provide a more informative newsletter for them specifically on their selected interest.
Whenever an entry in certain fields of Table A is made, I would like the same fields of Table B to be updated with that same information automatically. For example...
Client subscribes to our newsletter on our site and selects their interests, the email field now contains the subscribers email address and the various 'interest' fields contain a '1' telling us they are interested in that particular area of our business. As this takes place on Table A, it needs to be also replicated to Table B.
Surely this is possible, but how?
View 1 Replies
View Related
Apr 18, 2006
As I am an SQL novice I need some help
I have 3 tables
Table - Fields
SalesLedger - TransactionID, ProductID
Vouchers - TransactionID, Voucher_Ref
Products - ProductID, Product_Description
The Salesledger has fields TransactionID and ProductID
The Salesledger is linked to the Products table by the ProductID field
The SalesLedger is linked to the Voucher Table by the TransactionID field
How do I produce a query to list all the items in the Salesledger but if there is a Product in the Products Table matching the ProductID the Product details, and if there is a TransactronID in the Voucher Table list the VoucherRef.
At the moment, it only shows transactions if there is a corrosponding TransactionID in the Vouchers Table
Probably not explaned this at all well. I will try to elborate if required.
View 1 Replies
View Related
Jun 24, 2005
Hi all,
I am making a query which sorts birthdays into chronological order.
I have used the DatePart function to determine the month:
DatePart("m",[DATE OF BIRTH])
But I want to know how to display the month in CAPITAL LETTERS, i.e. instead of reading 1 it reads JANUARY
Thanks in advance
View 7 Replies
View Related
Feb 16, 2006
I have a list in Xcel of approximately 1100 client #'s that I have to match to our master list of 10000's.
I can create a query to pull these Clients, but I'd like it to only pull the 1100 requested. Is there a way to import an excel file to bump up against a query so that it only pulls the requested clients?
IE do I have to create a table and bring that data in then use them both in the query?
Sorry if this is a simple question, I'm just being thrown into the fire and have very little access background.
View 1 Replies
View Related
Mar 2, 2006
To start: Running Office 20003. I have created a survey with Frontpages wizard. Basically It has a topic and the end user rates that topic on a scale of one to five like so:
1. Work Environment
a. I enjoy my work place. 12345
b. I think my office has a good reputation. 12345
1-5 are radial buttons. It takes the users input and stores it in an access database as im sure you all are aware. Looks kinda like this:
1a 1b 2a etc.
3 5 1
What i would like to do is this: When the users are done submitting i would like to go back and take results. I.e. we had this many users select option 3 for question 1a and we had _ number of users select option 2 for 1a, etc.
The thing is i was wondering if there was a way to create a query for it. I know i could just put =1 or =2 but that would require running 5 queries on each question.... not fun. Anyway, any help would be appreciated.
Thanks,
Viko
View 1 Replies
View Related
Mar 22, 2006
Hi - I think this can be quickly sorted.
I use the following code in my query to merge together my customers details to 1 field:
LeadName: [Title] & Space(1) & [FirstName] & Space(1) & [LastName]
I want to do it for their address, what do i use instead if SPACE so that i get a NEW LINE each time rather than1 space to the right?
Thankyou
View 1 Replies
View Related
Apr 18, 2006
As I am an SQL novice I need some help
I have 3 tables
Table - Fields
SalesLedger - TransactionID, ProductID
Vouchers - TransactionID, Voucher_Ref
Products - ProductID, Product_Description
The Salesledger has fields TransactionID and ProductID
The Salesledger is linked to the Products table by the ProductID field
The SalesLedger is linked to the Voucher Table by the TransactionID field
How do I produce a query to list all the items in the Salesledger but if there is a Product in the Products Table matching the ProductID the Product details, and if there is a TransactronID in the Voucher Table list the VoucherRef.
At the moment, it only shows transactions if there is a corrosponding TransactionID in the Vouchers Table
Probably not explaned this at all well. I will try to elborate if required.
Edit/Delete Message
View 3 Replies
View Related