I have a question on date order please see attachment. I have changed the numerical value into a date abbreviation with an iif statement in design view via another crosstab query.
I am now trying find out a way to start the data with April and ending with March for my financial year. Any help would be appreciated.
I have a cross tab query. Essentially it groups together posted volumes into week numbers for different offices.
However, when I run the query, the order of the columns is not in a logical number order. I get Week 1 then Week 10 then Week 11 and Week 2 is further down the list and then Week 20 comes after that.
I would like if at all possible the Week Numbers to follow after one another i.e. Week 1 first then up to Week 52 in correct number order.
In my Dates Table I do have a SortID column which I hoped would resolve this issue so I could sort on the SortID column however this fails to work.
Attached is the query...
Code: PARAMETERS [Forms]![frmSumOfVolByCCAndFormat]![cmbOfficeSearch] Text ( 255 ), Forms![frmSumOfVolByCCAndFormat]![txtStartDate] DateTime, Forms![frmSumOfVolByCCAndFormat]![txtEndDate] DateTime; TRANSFORM Sum(tblTrafficEast.TrafficVolume) AS SumOfTrafficVolume SELECT tblOffice.CostCentre, tblOffice.OfficeName, tblTrafficFormat.Format, Sum(tblTrafficEast.TrafficVolume) AS [Total Volume]
I currently have records that end with a letter and 2 numbers. For example, A1, A2, ... , A10, A11. When I try to sort my table/query by these values, A10 & A11 come before A2. It seems that it is sorting by the first digit shown. Is there any way to fix this quickly within table/query properties so that this can be displayed in proper numeric order?
Hi, Wish if some one could help me ASAP. I have a table which contains name, tel, email i need to import only records which have distinct email. I do need need to import data of all three fields but only which has distinct email. As there are number of record which are duplicate. They have different names but same email. So i need to condition only for distinct email but dump the data in a new table with all three records. so same names can have different email. but same email can't have duplicate email. So need only records which have distinct email. Please help .......
Im having some probs with a DISTINCT query and hope you can help me out.
In the simplest terms I have a table that has 3 fields. Firstly the BikeManufacturer, then the BikeModel and finally the EngineCC.
Now from this table I am dynamically creating a drop down list via an AJAX request.
See it here .
When the user clicks on a manufacturer the select should be created showing DISTINCT BikeModel.
This could simply be achieved with a DISTINCT Statement but what I also want to do is order the list by the EngineCC.
Now if i put both fields into the DISTINCT statement i get duplications of the models since they dont all have the same EngineCC. But if i leave out the EngineCC from the select then I cant order by it.
I am working in Access 2003. I have a combo box based on the query below that works perfectly except that it shows duplicate Department Names in the combo box. I have not been able to find any way to show the Department Name only once. I have tried putting in SELECT DISTINCT in the string, but to no avail I recieve an error : ORDER By clause(DepartmentMembers.[DepartmentMembers]) conflicts with DISTINCT.
Any light you can shed on this subject would be greatly appriciated. I have been researching forums for over two days and have not been able to generate a solution to this. Thank you in advance!
SELECT Departments.[Department Name], DATA.[BUILDING LOCATIONS], DATA.[REPORTS TO], DATA.[DIRECTOR NAME], DATA.[NUMBER OF PERSONNEL], DATA.[PC NAMING CONVENTION], DATA.[CISCO SWITCH(ES) ATTACHED], DATA.[SERVER-BASED APPLICATIONS USED], DATA.[DEPARTMENT SHARE (Z:DRIVE)], DATA.[EXTERNAL SERVERS], DATA.[Department ID] FROM (DATA INNER JOIN DepartmentMembers ON DATA.[Department ID]=DepartmentMembers.[Department ID]) INNER JOIN Departments ON (Departments.[Department ID]=DepartmentMembers.[Department ID]) AND (DATA.[Department ID]=Departments.[Department ID]) ORDER BY Departments.[Department Name], DepartmentMembers.[Department Members];
I'm trying to QUERY an ACCESS database called ARQUIVO and i would like to have from the column EMPRESAS all the DISTINCT records that have the same 'aviacao' in the INDUSTRIA column.
and it goes like this: Code:<%Set rse = Server.CreateObject("ADODB.Recordset")sSQL = "SELECT DISTINCT empresa FROM arquivo WHERE industria='Aviacao'" rse.open sSQL,con, adOpenStatic, adLockPessimistic, adCmdText%>
But all I get in a 500 error.
The fact is that if I use "*" instead of "empresa" the query runs but i list all the records with 'aviacao' in INDUSTRIA
I have this SQL query made in ACCESS - that does what I want - but it doesn't rune in mine ASP page.
SELECT DISTINCT arquivo.EMPRESA, arquivo.INDUSTRIA FROM arquivo WHERE (((arquivo.INDUSTRIA)="Cāmaras Municipais"));
I need to get all the services for one license, but only once, you'll see what I mean
Pk Service Service_Name MyDate Fk_Licence 1 Base 10/5/2004 5 2 Base 12/6/2004 5 3 Super Base 11/4/2004 5 4 Base 20/10/2004 5 5 Super Base 17/7/2004 5
there's about 7000 records with the same 4 services recurring all the time
All I want for one license is the all distinct services for a chosen date
If I select License 5, and today's date, 26/10/2004, I would need the latest service (closest date but has to be inferior or equal), in this case
Pk Service Service_Name MyDate Fk_Licence 4 Base 20/10/2004 5 5 Super Base 17/7/2004 5
Here's the query I have:
select distinct Service_Name from Services where Fk_License=5 where MyDate <= SelectDate order by DateDiff('d',SelectDate,MyDate) DESC
where Fk_License is to get only the services for a particular license distinct if to only get each service once MyDate <= SelectDate if to get only the services older than the selected date order by is to get the latest service cause there will be a lot of services older than the selected date
Hello, On a form I have a way to search for a record by using a listbox that has a Distinct Row Query from the table that the main table that the form is bound to. It looks for the Sample ID's that are associated with the samples that we test. The list ends at record 87877. We are WAY past that number in our numbering scheme but the list box does not display all the records. When the users type anything over 87877 the auto complete doesn't work and the last record shown in the list is 87877. Does anyone have any idea how to make all records show? The users use this to navigate quickly between samples but now it is broken. Is there some sort of limit? Thanks Greg
I've got two nested queries. One finds the oldest inspections from an import table, the second compares that query to the main table again and pulls all 'expired' inspections for each Service Order in the first.
These queries are trimmed down for the essential elements of my question. I can post the full SQL if necessary.
queryDoTheseFirst:
Code: SELECT TOP 18 ImportTemp.[SO ID], ImportTemp.[Inspection Activity], [Activity Created]+[AddDays] AS [Due Date] FROM [Priority List] INNER JOIN (ImportTemp INNER JOIN queryNeededFirst ON (ImportTemp.[SO ID] = queryNeededFirst.[SO ID]) ON [Priority List].Activity = ImportTemp.[Inspection Activity]
[Code] ....
The refinement I would like to make is, rather than having to pull TOP 18 activities in the final query, just pull TOP 12 [SO ID]s and however many activities come along with them (usually 1 or 2, averages out to about 1.5 so 18 is my compromise). In theory an inspector could have two inspections due on every single property, and would only get 9 unique addresses/[SO ID]s. But I can't figure out how to do that when [SO ID] is no longer unique in the second query.
I suppose I could 'number' the rows in the subquery and add a <=12 criteria on that calculated field, but I'm leery of the processing required (that table contains ~14,000 rows, and most methods of numbering seem to want to use DCount).
I'm trying to create a report for how many "nasty grams" (rejection notices) my company has sent to people who keep sending in paper forms when they are supposed to file electronically.Every letter that goes out has information recorded based on whatever they sent to us - so the only remotely reliable way to count how many each person received is by the address on the envelope (people use different names, different business names, use different telephone numbers on the forms, etc).
I just built several queries that feed into a report that gets sent to my boss on a monthly basis to show the people who've sent in more than one paper form and have received our rejection notices more than once.I'm not the greatest at SQL, but I've been trying to find a way to use DISTINCT Addresses, leave all other fields the same (not DISTINCT), to:
1. Only return people who have received 2 or more letters
2. If at least one of the letters was sent more than 90 days ago AND If at least one of the letters was within the last 90 days -If at least one was within the last 90 days, only display the most recent send date of the letter (lots of people get back-to-back letters).
3. Display their names, addresses, telephone numbers, the date of the most recent letter sent, count of the total letters ever sent to that person. (the report will already do this, just need Max date)
My first query counts the number of times each address appears in the main table and simply only has [Address] and [CountofAddress]
My second query has the [Name], the [LetterDated] >=Now()-90, and the qryCountofAddress is linked to the main table by [Address], using [Countof Address] >=2...I have tried Selecting Unique Values in the Properties tab. Yes, I have tried INNER JOIN (but can't get the rest of my fields to display once I make addresses distinct).
i have a database with 3 main tabels: customers, items being sold and orders. i am having problems with having more than one item assigned to a order. can anyone help me please? i am new to access so if anyone can help can you explain in symple steps? thanks mooink
i removed the DIsTINCT in my query to move some field to be updateable on the form. Once I did that my detail section of my form was empty ..why and how do I fix this problem.
hello i have created an ordering sheet for my company. i want to know if it is possible to automatically record the time of each order made? If possible could someone tell me how it is done?
Also is it possible to put a clock in an Access database?
hello i have created an ordering sheet for my company. i want to know if it is possible to automatically record the time of each order made? If possible could someone tell me how it is done?
Also is it possible to put a clock in an Access database?
Is there a way of , when a database administrator enters a new rocord to a database, making the new record appear at th e top of the table it is enter ed into, i.e can he prefix the entry to tell access to put the record at the top of the table
I have a database containing music library data, with fields <Composer> and <Title>. I have a form that shows a these fields as lists, but I want to add a button at the top of each list to order the data by that field. How do I do it?
I think this may be impossible but I am hoping it isn't :)
Have any of come across a way to Manually order a continuous form.
The way I would see it working is to have a column in the table called sort_order and two buttons on the form called move up and move down. Once clicked the sort_order value would change thus changing the order on the form.
I should imagine it would be alot more complicated than my brief description, in fact it may like I said be impossible.
If any of you have an idea how to achieve this I will be very grateful
I have actually 2 questions. They are probably very easy to solve, but I have no idea where to start looking.
1) I have a form (Form1) which has a combo box. When pressing "F2", I start a second form (Form2).
On Form2 I want my records order by Name, but I always have them ordered by ID. I tried the "Order By" property on the form, but that doesn't seem to work.
2) When closing the form, I want the selected (or the newly created record) to be the current record in the Combo box on Form1. How do I do that?
I have a field in a table on Access 2000 database with takes the following information in any order and can be repeated. e.g. can have 10, etc people with contact signed, 10, etc people with PDD issued, etc.
contract signed PIN issued PDD issued validation finished Host country approval EB approved CER's issued.
I am designing a report in which I want to Group and order the info. in the field in the order shown above, e.g 1. contract signed, then 2. PIN issued followed by PDD issued, etc in Ascending order say and the other way round say CER's issued, EB approved, etc.
Can anyone help here? I have not much experience with designing reports but I have tried using the report Sorting and Grouping and it does it in aphabetical order, not in that order I require.
Although the The Val function reconverts the text, produced by the Format function, back into a number the IIf function seems to convert back to text again. This means that in the Report, when I order the values in descending order I get:
NA 50 50 50 40 28.57 14.29 100 10 0 ...
Is there anyway round this, to order the numbers and leave the text value NA at either end?! Hope this makes sense! Any help very welcome. mcchu