Is It Possible To Display The Records This Way With A SQL-query?
Mar 14, 2005
My mini database has 11 records stored in a table called “Products”. The table has two columns called “P_name” and “P_price. The records are stored in the following way and order in the database:
Counter P_name P_price
1 Shoes 15
2 Coat 16
3 Cardigan 4
4 Shoes 9
5 Cardigan 7
6 Trousers 15
7 Coat 8
8 Cardigan 14
9 Shoes 2
10 Trousers 12
11 Trousers 8
My question now is whether there exists any SQL query that will select all products and then be able to display the recordset in the exact order below (P_name should not be displayed in alphabetical order, but grouped together with other in same product category and therefore displayed after each other. P_price should be in ascending order). I have managed this far: SQL = SELECT * FROM Products where ?????? ORDER BY ?????, price ASC.
Coat 8
Coat 16
Trousers 8
Trousers 12
Trousers 15
Shoes 2
Shoes 9
Shoes 15
Cardigan 4
Cardigan 7
Cardigan 14
If it's not possible to achieve this using SQL, maybe you can suggest something else?
View Replies
ADVERTISEMENT
Jan 19, 2006
I have a query that querys another query for check boxes that are checked. I would like to display in a text box on a form the # of records that the query found to be checked. I have looked all day and have found nothing that I have enough knowledge to use. I need to know how and how to apply this. If you have other suggestions to do this, I am game! :)
Thanks!!!
View 11 Replies
View Related
Sep 22, 2014
in my query i have multiple tables, one table just has one field called product thats joined to another table the other table displays a list of all products, if the product is in the other table.i want a "X" to display in that field both columns are text the IF im using is,
IIf([Product] Is Null,"","X")
but when i run this, it displays no records what so ever, if i take out that iff, it displays all records i want, but that field is the product number when i need an X
View 4 Replies
View Related
Aug 9, 2013
I have a date field in a table. I wish to display in a query:Column A representing the month. Column B representing the number of records in the table corresponding to that month.
View 5 Replies
View Related
Oct 28, 2013
I have a db which has a query. This query is rather simple where it filters fields based on criteria. Here is the SQL VIEW:
SELECT DSResult.STATUS, DSResult.TESTCODE, DSResult.BATCHNO, DSResult.TESTNO, DSResult.TESTDATE, DSResult.CODE
FROM DSResult
WHERE (((DSResult.STATUS)="TESTED") AND ((DSResult.TESTCODE)="41015" Or (DSResult.TESTCODE)="41016") AND ((DSResult.BATCHNO)<>"1") AND ((DSResult.TESTDATE)>=#1/18/2010#))
ORDER BY DSResult.TESTCODE, DSResult.TESTDATE, DSResult.CODE;
I need to alter this query so that where records that have the same "DSResult.CODE" and counted are greater than 20 occurrences and then display only these records sorted in DSRESULT.Code order.
View 6 Replies
View Related
Nov 13, 2011
I created a subform that displays the records of a select query after selecting the desired data from a single combo box (for instructors name) and then using an OpenQuery macro attached to a button.
Only 1 record is displayed in the subform each time I hit the button. If I look at the query return there is no change. However, if I close the query and select a new instructors name, although I only get one record in the subform, the query when opened shows all the correct records.
What is wrong with my macro/subform?
View 8 Replies
View Related
Dec 10, 2006
Dear friends
How could I get top 50 records from a table?
have a nice day
JB
View 2 Replies
View Related
Aug 29, 2006
Hallo Everyone,
I hereby attach a screenshot of one of the forms I have. the problem is that I need to display the current record (for which the subform is opened) to be highlighted or else only that record is seen. I have the data in the datasheet view.
any suggestions will be also helpful for me.
thanks in advance.
regards,
aravind.s
View 1 Replies
View Related
Aug 26, 2007
Hello,
I am creating a query where one of the field criteria depends on the value selected from a combo box. So if a user select 3 only records with the value 3 on that field is displayed...
My problem is how can I display all records on the query when nothing is selected from the combo box?
So if users doesn't select a value,, all records should be displayed
i tried the following if statement in the query but it's not working:
IIf(([Forms]![Switchboard]![Prioirity]>=1);[Forms]![Switchboard]![Prioirity)
Please i need your help....
Thanks
View 11 Replies
View Related
Feb 15, 2006
Is there a way to display a number (on a Form) for the number of records in a specific table? I just want to reference how many records there are. I tried to search this topic, but couldn't find anything. Thanks.
View 10 Replies
View Related
Aug 16, 2007
I have built a report but it only displays one record. I am not using a filter. The records are being pulled from a query that should display 26 records. If I change the sort criteria, i get a different one of these records each time, but i cant get them all to display on the report at the same time. Any ideas?
View 7 Replies
View Related
Dec 11, 2007
Hello,
I'm attempting to create a report for a major school district in TX. I need to have the total number of records entered each month and a cumulative number of records entered for the year. Can anyone help me with this?
Thanks
View 2 Replies
View Related
Mar 21, 2013
I have a table that contains names and dates and ids
Example :
Id. Name. Date
1. Bill. 10 /2/2013
2. Jim. 12 /3/2013
3. Alex. 20/3/2013
3. Alex. 5/3/2013
I want the query to display the names that have record's in a month and also display those who haven't with zero.
An example of march should be like :
Name. Count
Bill. 0
Jim. 1
Alex. 2
View 3 Replies
View Related
Aug 31, 2005
hi. i would like this to happen....
i have a database where jobs are entered and the date and times of the jobs are kept in separate Date and Time fields.
to enter a date the user uses this method "30 12 05" and to enter a time like this "21.30"
i would like a query that will display the 10 most recent job additions according to their respective date and times. however, it will not be enough simply to view these records in a report.. what would be ideal is if the 10 records are opened.. in their original form format (goto next record...previous...(1/10...5/10) and the fields are editable like in the default job entry form. this is because after a job record has been added, maybe 20 or so minutes later, that record would need to be retreived as the last bits of information for that record will have been established.
how can this be acheived. i am clueless at the moment, so if there is a solution even resembling this scenario that would be ideal. (if a filter is going to be used...it can be either the 'date' or the 'time' fields, ideally though the query would use a combination of the two to retreive a more exact date to filter the records by)
thank you access world for even considering my dilema.
View 2 Replies
View Related
Dec 6, 2006
ok.. here is a pickle..my table layout is like so..http://www.londonheathrowcars.com/hoo.jpgthe job table stores the main job details.. every job will be in this tableSOME jobs will have incoming flight details... some wontSOME jobs will have outgoing flight details.. some wontSOME jobs will have incoming AND outgoing flight details.. some wont have anyalso SOME jobs (credit card jobs) will have credit card details.. some wontthis is the general problem i am facing..there are 2 records in my job table..jobref no. 020jobref no. 021jobref no. 020 has incoming flight details.. outgoing flight details.. and credit card details.. which means... the job ref no. 020 is present in all 4 tables..jobref no. 021 has incoming flight details.. it does not have outgoing flight details or credit card details.. which means the job ref no. 021 is present in the job table and the incoming flight table onlyi want to create a form that displays every field in the database..my idea is to make a query using all four tables.. and then the form will display the results..HOWEVER!!!!!!!!the form will only display the job ref no 020.. because job 021 is not present in all the tables...why.. is there a way around this.. cant it just display both records and if job 020 does not have card details.. just leave those fields blank.. then on this form.. if i happen to add card details to job 021.. it will just create the record in the card table using the same ref no..is that clear.. someone please enlighten me
View 2 Replies
View Related
May 2, 2005
:rolleyes: Hmm how should I put it? I want like to create a form so I can show 8 to 10 records at a time on a single page (instead of using continuous form); so when I press the next button, the next set of 8 records will be show on the next page.
Is it possible to do that with Access?
Thanks,
Jason
View 1 Replies
View Related
Aug 5, 2005
I am using a SQL statement as the rowsource of a listbox. the expected result should be a list of 452 items which I verified by pasting the SQL statement into the Access query design and running the query directly. For some reason, in most cases, the listbox will only display 21 records. Other times it may display more than that (with the same SQL statement). What's really unusual is when I click on the form's "Find" button after the first set of 21 lines appears: it will then append more records to the list. Sometimes by doing this I can display all 452 records. The results seem to be somewhat random. I've tried adding delay loops, DoEvent statements, multiple requeries, repaint, etc. -- nothing I've tried seems to help. Any ideas?
View 3 Replies
View Related
Sep 27, 2005
Hi dont know how im gonna explain this but here goes,
I have a table of businesses and each business has vacancies and consultancy time under it through related tables, so i have
Businesses
|
------------------
|.......................|
Vacancies........Consultancy
I want to be able to display all the Vacancies for one company in a form and all the consultancy in one form, i know i could do it though querys but i have 600 companies and that would be ridiculous.
Is there any way i can do it by selecting a business and been able to see all records for that business.
Thanks for your help
View 2 Replies
View Related
Jun 2, 2006
Hi, this problem is probably very simple to solve but I can't seem to find an answer to it.I have created a search form that returns all records meeting the criteria back into the search form. What I want to be able to do is to display the records in a datasheet view. This is what I currently have and it works ok but how do I convert?Private Sub cmdSearch_Click() Dim LSQL As String Dim LSearchString As String Dim LTownString As String Dim LActive As Integer Set LSQL = Me.RecordsetClone If (Len(txtSearchString) = 0 Or IsNull(txtSearchString) = True) And (Len(txtsearchTown) = 0 Or IsNull(txtsearchTown) = True) Then 'MsgBox "You must enter a search string." Else LSearchString = txtSearchString LTownString = txtsearchTown Select Case Me.Frame99.Value Case Is = 1 stActive = " AND Active = -1" Case Is = 2 stActive = " AND Active = 0" Case Is = 3 stActive = "" End Select 'Filter results based on search string LSQL = "select * from tblContacts" 'LSQL = LSQL & " where LastName LIKE '*" & LSearchString & "*' AND Town LIKE '*" & LTownString & "*'" & stActive If Form_frmMain2.RecordsetClone.RecordCount = 0 Then MsgBox "No records found" Else Form_frmMain2.RecordSource = LSQL End If 'Clear search string txtSearchString = "" txtsearchTown = "" End IfEnd Sub
View 2 Replies
View Related
Jan 10, 2005
Hi,
I am new here and have been using the build features (and not the code as I do not understand this) to build my registration database.
I have several tables of imported data nicely displayed in one form with tabbed sections. When I tried adding new records by entereing them in the form, they are saved in the underlying tables but the new records are not displayed in the form when I go back into the form.
All the tables seem to be linked to the form when I go into the form selector and Edits are allowed in the property box.
Any ideas on what the problem might be?
Danielle.
View 2 Replies
View Related
Aug 27, 2003
After creating a recordset how do I display the number of records in it?
View 2 Replies
View Related
Sep 3, 2013
I have a subform to select which Managers will get a Corrective Action Report based on a single Non-Conformance ID. The queried information looks like:
ID Managers
01 QA Mgr
01 Maintenance Mgr
01 Shipping Mgr
How can I access this data 1 record at a time in order to have each Manager name print on a separate Corrective Action Report?
View 4 Replies
View Related
Apr 3, 2013
I have a form that shows data from tables tbl_AgencyInfo, and a subform showing data from tables tbl_CourseInfo & tbl_StudentInfo. Each agency can have mutliple students and multiple courses, so that is why it is set up this way.
My subform will only display one record at a time, however, even though there are multiple students/coursess that relate to the agency. I am thinking something is off with my relationships but I'm not totally sure. In previous databases I have linked my tables together in a central table, but that table in this case does not seem to be populating.
View 14 Replies
View Related
Oct 22, 2013
I have one table containing all neccessary detail of members of varius soceity
I create a query to find name of all society(ies) for one person
When i create a form to the that query it show all record in form view,datasheet view but when i insert this form as sub form in other form it shows only first record.
main form and subform not connected each other as main form linked with table and subform with query
View 2 Replies
View Related
Sep 7, 2014
I am putting together a database in access 2013.
I need to put in a form which basically lists all the clients names, with a button next door to each name, allowing them to edit their details. Is this possible.
Basically when loading the form, all client names are displayed in alphabetical order. Clicking on the edit button next door to the client, displays the client details in another form for easy editing. How can I do this .
View 1 Replies
View Related
Oct 16, 2015
I have a form on access, that displays data for the customer and products that he has purchased. I want to set it up in such a way that if I click on the customer it shows all the products he has purchased. And if i click on the products, it goes to the product information page(form).
I currently have a form in which I have put in two text boxes that have the product and customer fields as data source. The form displays records from a query that is used to filter the customer's purchased products sorted ascending.
The form is working partly correct. It displays only one product from the customer that is in ascending order but not all. If I add more text boxes, it displays the same first product repeatedly.How can I set it up as to display all the products that the customer bought for each customer?
View 2 Replies
View Related