Search results

  1. K

    Select Distinct vs. Group By

    Hi Guys, I am trying to get a distinct count of students that have had tutorials and group this by the department they are in. At the moment I am using the query below but this seems to count the total number of students in the tutorial table and not just pick out the distinct ones. SELECT...
  2. K

    Just added a field and now query is over calculating!

    Thanks that worked really well. I am having a similar problem with the SQL statement below: SELECT Count(*) AS Students FROM (SELECT DISTINCT StudentID FROM tbl_Tutorial) AS T, tbl_Tutorial WHERE (((tbl_Tutorial.Date) Between [Forms]![frm_Dates]![txtFrom] And...
  3. K

    An append query based on data in an excel list?

    Hi, I imported the excel table into my database called 'tbl_Enrolments' Then I tried to create an UPDATE query but am not sure on the correct syntax. I want to update the field called 'course' in table 'tbl_Student' with a corresponding match in tbl_Enrolments WHERE the studentID matches.
  4. K

    An append query based on data in an excel list?

    Thanks I will give that a try :)
  5. K

    Just added a field and now query is over calculating!

    Hi there, I am using a query to get a rough count of how many students have had more than one tutorial. This was working fine until I put a WHERE clause to add a 'TO' and 'FROM' date statement. Here is my SQL: SELECT Count(vTbl.StudentID) AS StudentsMore FROM (SELECT StudentID FROM...
  6. K

    An append query based on data in an excel list?

    Hi there, I have a table called tbl_student with student ID and several other fields. I have recently received an excel spreadsheet with a list of student IDs and their courses. How would I go about running an append/update query to update each student with no course if they exist in the...
  7. K

    Me.Filter and make records appear in descending order?

    Hi there, I have a student form which is used to enter data about students. I have added a couple of filter buttons so it is easier for the admin team to find blank fields to carry on entering data. Ideally though, I want the filter to also show the records in descending order by created_date...
  8. K

    DISTINCT and COUNT together?

    Hi there, I am trying to write a query to count the number of distinct students that belong to each faculty and a gender breakdown of this. My query is as follows: SELECT distinct Count(tbl_Tutorial.StudentID) AS CountOfStudentID, tbl_Student.Faculty, tbl_Student.M_F FROM tbl_Student INNER...
  9. K

    Combo box and then fill textboxes

    Thanks for all the responses. I have got it working thanks to all your help! :)
  10. K

    Combo box and then fill textboxes

    Hi there, I am using a combo box with a control source consisting of a query of these fields: Course Faculty Department I have two textboxes called 'faculty' and 'department'. The way it should work is as follows: The user selects a course from the dropdown list, the corresponding...
  11. K

    Automation object error

    This line is highlighted after debugging the error Forms!frm_tutor!Tutorial.Form!StudentID = Me.QuickSearch.Column(2)
  12. K

    Automation object error

    Thanks for replying. No Quicksearch.column(2) is referring to the third column in the list.
  13. K

    Automation object error

    it is a listbox
  14. K

    Automation object error

    Hi All, Attached is a screenshot of an error message that seems to occur sometimes but then at other times it works fine. It happens on searching for a student and trying to click on a result to transfer the text to a form. The code I am using is as follows: Private Sub...
  15. K

    on entering a number in a textbox, check if entry already exists?

    Hi All, Sorry for the delay in replying. The StudentID was defined as a number in the underlying table and the code kindly provided by Denniskworked well! Dim iStudentID As Long 'the primary key of the student table iStudentID = Nz(DLookup("[iStudentID ]", "tblStudent", _...
  16. K

    on entering a number in a textbox, check if entry already exists?

    Hi there, An administrator adds students to a database via a form. He types in the student number and the other student details and then this is saved in the database. The problem is, sometimes he does not check if the student already exists and it doesn't return the duplication error until...
  17. K

    Problem with DISTINCT Count

    Hi this didn't seem to work. Went to run the query with this code and it said there was a syntax error. Any other ideas?
  18. K

    query as a subform - how to make each item clickable

    Hi All, I have a blank form and have inserted a subform, this is a table of data from a query. Is it possible to put an on click event on this like as if it was a listbox? Thanks Kate
  19. K

    Problem with DISTINCT Count

    Hi All, I am trying to count the number of different students seen between two dates. I have tried the following: SELECT Count(*) AS Students FROM (SELECT DISTINCT StudentID FROM tbl_TutorialRecords0708) AS T WHERE (((tbl_TutorialRecords0708.Date) Between #9/1/2007# And #8/31/2008#)); this...
  20. K

    Import some data to existing records?

    Hi everyone! I know how to import spreadsheet data into an access database but only whole data for a new table. Is it possible to import certain fields for certain records that already exist in a database table? For example, if I have a student in the student table who exists in the table...
Back
Top Bottom