So, I have some complicated calculations I am aliasing in my SQL query. My end goal would be to sort by my final calculation from all the other calculations I have performed but I am running in to some issues. I know I can't sort by referencing the alias itself without saying order by (column number). My calculations are usually pretty small (around .001 and up). Whenever I order by the column number I would like to use (select... from... where...order by 73) I get a "Division by zero" error in access. I figured this was an issue with how small the calculations were, so I multiplied by 1000000, then ordered by that column number. Still division by zero...I went ahead and changed all 0 values to 1, still division by zero. There are no zero values in the column itself, it's either 1 or something in the thousands. I can order by other columns, just not the one I want to use. I don't want to have to re-do my entire calculations in my order by clause.
I have got a number of queries that query an MSSQL database that were running fine, but then I decided to tidy them up by giving them more meaningful column headings eg Pupil ref instead of tblPupil. Some of the queries are still fine but in some of them I can't get the columns to display in the order I want. In one, I have got columns called Round, Pupil ref and School but I can't stop the Pupil ref column coming first. If I delete it and put it in again, I can get it to go where I want (ie second) but as soon as I name it, it comes first and stays there even if I remove the name.
I have a access table with 32 columns and 42,000 rows of numbers. I need to find the MIN number in the row and if the MIN number has duplicates then I need them all placed into another column by column name. Example: Starting file DEST,ORIGIN1,ORIGIN2,ORIGIN3,ORIGIN4, ETC 05512,3,2,4,2
Hi, I have a querie that returns various data based on the page of a part's Sub-Assembly. There are 4 basic items returned for each page that display in my subform it displays as follows:
SpecID - Page # - Part# - Description - etc.
4 basic SubAssembly Descriptions are
1 - A Text Description of Assembly as a whole (varies for each record and usually has a number such as 2" or 3" or 4" etc at beginning of field) 2 - Valve 3 - Selenoid 4 - Actuator
I want to sort these records so that the first field is that Text description field. I tried sort descending and this does sort descending but puts text field last. (i Know that this is because it is sorting on text first and then intergers. But I don't know how to program multiple OrderBy for this column. How can I sort by intergers first and then by text on this field? :o
I create an inventory report which source is from a query. I have set a field "Date" displaying in ascending order in query. But the report cannot achieve that result. My code is:
Private Sub PrtDelRec_Click() DoCmd.OpenReport "DeletionTransferRpt", acViewPreview End sub
Why Access 2010 does not save the Datasheet order?? I keep setting the order and it puts it back again
I have set the order in the design. I have set the tab index individually for each item. I says in the tab order that they are in the correct order. I reorder them in the datasheet and click on save. Nothing sets that order. It will revert it back to the order that IT wants every time.
Why does access automatically rearrange column order in a query after closing and reopening? Is there a way to stop it? It doesn't affect the usefulness of my query but I set the columns up in a specific order and I'd like them to stay that way. This is an update query. I see that it is grouping them by name. Anyway to stop that without giving each field a unique name? Screenshots attached.
I have a subform in which I display a table in Datasheet View. The problem is, I cannot figure out how to place the columns in the order (i.e. from left to right) I want.
For some reason, right-clicking on a column header in Form View and selecting Freeze Fields will shift that column to the left but I can find no consistent pattern to it and no other way of shifting a column. Reordering the columns in the table itself seems to have no effect on the order they appear on the subform and moving the controls around in the subform in Design View also seems to have no effect.
I created a query, and in field one i have a list of SKU codes (of which many are repeats), and in field two I have their corresponding volumes. In Fields 3-5 I have some various algebraic calcuations.
Now, in order to get a sum of the volume with only one SKU code listed in column 1, I use a group by on the SKU code, and a sum for the volume. When these are the only fields in the query, this works great. But when I add in the other calculated fields, the run query returns to showing each SKU code multiple times, and shows the volume and the calculations correctly. When I change the other calculated fields to Sum, then I get the aforementioned overflow error and no output at all.
Is there a way to both set it so that the output is only showing one SKU code, the total volume for that SKU, and the weighted average output of the other calculations in one query?
I've been using MS Access 2007 for years to manage some Excel data. running some queries etc. Just recently I've been encountering problems when importing data into an existing table. When I do it now, I get a "Subscript out of Range" error. To troubleshoot, I imported into a new table and when doing so, the fields no longer match the column order of the spreadsheet. They all get imported but appears in a different order. I think this is why I am getting the error message. How can I go about ensuring that the data gets imported properly into my already existing table? My fields in "Design View" will match the order of the Columns in the Excel spreadsheet.
I'm opening a search form using DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria for user filtering purposes. I added a column which it now appears as the last column - I need it to be the 4th WHEN THE FORM OPENS. I can move after it opens, but it won't default there. Tried rebuilding the query and the form, but it still opens with this column at end of form - how can it be placed where I want it?
I know that there may have been many posts on this and I have searched for a total of about 2 hours in these forums before posting, so please don't shoot me down for asking this.
I simply need to know how I can create a unique, alphanumeric order number. I was going to use Autonumber, but from what I have read on these forums, that is not the way to go, as Autonumber is simply to identify the record.
What I need is an number like so: ST000. It needs to start at ST142 and increase by one each time. Obviously I would like to avoid gaps from records being deleted or not completed etc.....
I really have no clue how to do this, and would appreciate it if anyone can point me to a post that would help, or offer me the solution.
i have a query which looks at 2 fields: "employee number" & "agency number", i would like the query to list the employee numbers in order first (1,2,3...) then the agency numbers in order (100, 101, 102...). ive changed the ascending/ descending order for them both but doesnt help. Its mainly the form that looks at this query i would like to fix so that is shows all employee records in order of employee number first and then underneath all agency numbers in order of their number (some employee numbers & agency numbers are null) hope this makes sense , any help would be great
i am going to use the autonumber as an order number but I want " SC2015 in front of it so i end up with " sc20151 , sc20152 but next year i want it to change the year SC201650 .how to put the sc2015 in my report without any input from the user
I am on code want to display records on the form by order_number, but i am unable to do it.
Private Sub Combo63_AfterUpdate() Dim rs As DAO.Recordset Dim intcount As Integer On Error GoTo ErrorHandler Set rs = CurrentDb.OpenRecordset("SELECT * FROM Master_Log WHERE Order_number = " & Combo63.Value & "", dbOpenSnapshot)
I'm trying to trouble-shoot an undocumented datbase built by someone else and running into a recurring problem. She has it set up where a macro runs several queries. When these macros are run, the queries cause "Division by Zero" errors which stops the macro in its tracks. The following is a query that causes this error, but by looking at this query, I see no place where a division takes place. I'm assumming that another porblem is occuring and Access just states that it's division by zero error when it's actually something else.
1) Has anyone seen a "Division by Zero" error when running a query when it's actually something else causing the problem? 2) Can anyone see from the query what could possibly cause this and give me a hint as to a good way to trouble-shoot these queries to possibly handle whatever problem is occurring.
Thanks,
The query is as follows: SELECT [Buyer Category Fiscal Period for Report].FiscalMonth, [Buyer Category Fiscal Period for Report].FiscalYear, BuyerCategory.Buyer, BuyerCategory.Description, BuyerCategory.CategoryID, [008c GMROI by Category].[Category GMROI], [016c MTD GM by Category].[MTD GM], [017c YTD GM by Category].[YTD GM], [010c Turns by Category].[Category Turns], [005c MTD Cogs by Category qry].SumOfNetCogs, [004c YTD Cogs by Category qry].SumOfNetCogs, [006c MonthEnd Inv by Category qry].MonthEndInv, [014c GMROI Buyer Category].BuyerCategoryGMROI, [018c MTD GPM by Category].[Buyer Cat MTD GM], [019c YTD GPM by Category].[Buyer Cat YTD GM], [015c Turns Buyer Category].[BuyerCategory Turns], [005c MTD Cogs by Category qry].SumOfNetSales AS [MTD NDS], [004c YTD Cogs by Category qry].SumOfNetSales AS [YTD NSD], [Buyer Category Fiscal Period for Report].EndDate FROM ((((((((((((BuyerCategory LEFT JOIN dbo_Category ON BuyerCategory.CategoryID = dbo_Category.CategoryID) LEFT JOIN [008c GMROI by Category] ON BuyerCategory.CategoryID = [008c GMROI by Category].CategoryID) LEFT JOIN [016c MTD GM by Category] ON BuyerCategory.CategoryID = [016c MTD GM by Category].CategoryID) LEFT JOIN [017c YTD GM by Category] ON BuyerCategory.CategoryID = [017c YTD GM by Category].CategoryID) LEFT JOIN [010c Turns by Category] ON BuyerCategory.CategoryID = [010c Turns by Category].CategoryID) LEFT JOIN [005c MTD Cogs by Category qry] ON BuyerCategory.CategoryID = [005c MTD Cogs by Category qry].CategoryID) LEFT JOIN [004c YTD Cogs by Category qry] ON BuyerCategory.CategoryID = [004c YTD Cogs by Category qry].CategoryID) LEFT JOIN [006c MonthEnd Inv by Category qry] ON BuyerCategory.CategoryID = [006c MonthEnd Inv by Category qry].CategoryID) LEFT JOIN [018c MTD GPM by Category] ON BuyerCategory.CategoryID = [018c MTD GPM by Category].CategoryID) LEFT JOIN [019c YTD GPM by Category] ON BuyerCategory.CategoryID = [019c YTD GPM by Category].CategoryID) LEFT JOIN [015c Turns Buyer Category] ON BuyerCategory.Buyer = [015c Turns Buyer Category].Buyer) LEFT JOIN [014c GMROI Buyer Category] ON BuyerCategory.Buyer = [014c GMROI Buyer Category].Buyer) LEFT JOIN [Buyer Category Fiscal Period for Report] ON (BuyerCategory.Buyer = [Buyer Category Fiscal Period for Report].Buyer) AND (BuyerCategory.CategoryID = [Buyer Category Fiscal Period for Report].CategoryID) GROUP BY [Buyer Category Fiscal Period for Report].FiscalMonth, [Buyer Category Fiscal Period for Report].FiscalYear, BuyerCategory.Buyer, BuyerCategory.Description, BuyerCategory.CategoryID, [008c GMROI by Category].[Category GMROI], [016c MTD GM by Category].[MTD GM], [017c YTD GM by Category].[YTD GM], [010c Turns by Category].[Category Turns], [005c MTD Cogs by Category qry].SumOfNetCogs, [004c YTD Cogs by Category qry].SumOfNetCogs, [006c MonthEnd Inv by Category qry].MonthEndInv, [014c GMROI Buyer Category].BuyerCategoryGMROI, [018c MTD GPM by Category].[Buyer Cat MTD GM], [019c YTD GPM by Category].[Buyer Cat YTD GM], [015c Turns Buyer Category].[BuyerCategory Turns], [005c MTD Cogs by Category qry].SumOfNetSales, [004c YTD Cogs by Category qry].SumOfNetSales, [Buyer Category Fiscal Period for Report].EndDate ORDER BY BuyerCategory.Buyer;
I have a field in the a query with the following: % OVER NB: 1-([Monthly MTA Table]!NB/[main inventory table]!PRICE) I then format the column in properties to percent When I try to put anything in the criteria I get an error "Division by zero"
I want to only the records that are greater then 80%
I have a query with the following calc. but it has an error of 'division by o' when I run it. Some of the figures may be null or 0 within the fields and I still want it to return a % figure result
I know its probably the iif function but am not sure how to use it in this instance.
Process %: Sum([Process volume]*[se]/[minutes worked])
I am trying to create an auto-sequential order number
Example : AB000112 - AB is standard prefix, ''0001'' is the first invoice number, ''12'' is the year 2012.
so the next order number should read AB000212 and the next AB000312
Out of this, I have to issue several debit notes relating to the same order number when the payments are due from customers over a period of time, this will be
what I then would do is copy that to a purchase order but remove the negative sign can this can the formula be changed in anyway to give the positive number .
I have a table named "Patients" with a field named "Code" and another field named "Patient" which contains the full name (LastName space FirstName) "Chaviatsos Nick" for example. I want to make an other table from the table "Patients" with three fields: 1. A field named "Code" 2. A field named "LastName" which will contain the Last Name of the field "Patient" of the table 'Patients" and 3. A field named "FrstName" which will contain the Frst Name of the field "Patient" of the table 'Patients" How Can I manage this?
I am looking into re-creating something I have created in Microsoft Excel into Microsoft Access.What I do in the Excel spreadsheet, is when I type in an order number, various fields in the spreadsheet are populated using vlookups and ODBC's.
I wish to re-create this in Access but not sure how. I have a basic form, with various fields such as, order number, part number, description, quantity.What I have in my mind is that I would like to be able to type in an order number, then the rest of the fields would be populated by a query to a SQL Server database.i can see a way to do this using VBA but would rather look for a more direct way if possible.