Modules & VBA :: Make Table SQL With Percentile Parameter
Aug 18, 2015
I am using a function to calculate the quartiles from an existing query and enter the corresponding EqNum and EDescription into a table.When I run the code below it asks me for a value for SysAssetCritRankQ from the rstPercentileRST parameters. I have tried adding "" and [] but they aren't working.(The issue with self taught SQL/VBA)
SysAssetCritQ = Query Name
Total = Calculated field in query
Code:
strSQL = "SELECT SysAssetCritRankQ.EqNum, SysAssetCritRankQ.EDescription INTO [EOQComboT]FROM SysAssetCritRankQ " & _
"WHERE Total >= PercentileRst([SysAssetCritRankQ], Total, 0.75); "
I'm trying to copy the structure of a table to make a temp table. I'm using CopyObject (which also copies the data). So when I delete the data from the temp table, it also deletes data from the source table. Is the data linked? It should just be deleted from the temp table. Below is the beginning of the code. I've stepped through, and at the last step shown, the data in the source table deletes.
Code: Dim strFile As String Dim temp As String Dim tbl As String Dim db As DAO.Database
Hi I found the code to calculate percentile value and It works fine, my problem is that code is calculating value for the whole data set, not for the filtered data. PercentileRst («RstName»; «fldName»; «PercentileValue») is it possible to put some function that can filter or sort data like it do access queries for the mean calculation for example: dp1 100 dp1 90 ... dp2 89 dp2 78 ... percentile value for dp1, dp2....
I have a table with 3 fields. The fields are down1, down2 and down3. . I would like to use this table to create a new table (downtime). What I need too do is loop through each record in the table and place the three fields independently in my new table. For example, I would like to go to the first record in my original table, than place down1 as my first record in my new table, down2 as my second record and down3 as my third. Than I will go to the second record in my original table and place down1 as my fourth record, down2 as my fifth record, down3 and my sixth record and so on. I want to make a toggle button that will do this.
i have a table with 7 columns. Assume THE columns are a,b,c,d,e,f,g. In this table there is only one row and each column is given a number value. For example, a is 1, b is 5 and so forth. Can i make a pie graph in access with these 7 labels, and show there totals in the graphs?
I have a function that when called transfers a query recordset to an excel spreadsheet then emails it. At the end of the function I use code to write the date sent to a table. Each time the function is called I only need records in the query that have been modified since the last time the function was called. I have a field in the query 'LastModified' with a criteria '>[Enter Date]'. I then look up the date in the table and enter it manually. I know how to look up the last date sent in table using code but getting the >#SomeDate# in the query with VBA.
Access 2010 vba - I'm trying to pass a start date and end date to a date field in a make table query, and use the 'between' operator on that date field.
So I have a criteria on the date field like this "Between [dtStart] and [dtEnd]" and if I run the query manually it asks for 2 values and then works fine.
Here's the code I'm trying to run:-
Set qdef = db.QueryDefs("qryTest") qdef.Parameters("dtStart") = StartDate1 qdef.Parameters("dtEnd") = EndDate1 Set rs1 = qdef.OpenRecordset(dbOpenDynaset, dbSeeChanges)
and I get the error "3219 Invalid Operation" on the last line.
I need to remove html text from a make table in access 2007. My table name is "Bad Actors Comments Column" and the column where the html text resides is "FirstOfADD_TEXT. VBA code to remove the html text?
I am using VBA to execute a 'Make Table' (named 'DT'). One of the fields in DT (named 'Dollars') contains numbers that have 6 to 8 digits; some are positive and some are negative.
These large numbers with no commas (or parentheses when they're negative) are incredibly hard to read.
Any VBA coding that will change both the "Format" and the "Decimal Place" Field Properties on the table I make (i.e. "DT"). I want to the Format property to read (#,##0.00;(#,##0.00)) and the Decimal Place property to read "2"). This will allow me to display a number like -10326786.41 as (10,326,786.41) which is incredibly more readable.
Is it possible to do this programmatically; I've search the internet high and low and could find anything remotely useful.
Any method by which one can calculate the Percentile Ranks for the IV Implied Volatility in a Stock Market Database ?
IV Percentile rank simply tells us whether implied volatility is high or low in a specific underlying based on the past year of IV data. For example, if XYZ has had an IV between 30 and 60 over the past year and IV is currently at 45, XYZ would have an IV rank of 50%.
My table has got the IV Value for each symbol for the past one year and I need to calculate the IV Percentile Rank for each symbol based on this past one year data.
Hi, I am extracting data from linked db2 table using access make table query. First I create a select query and can view the linked db2 data, but when I change to a make table query I get an error message, "invalid argument", when I run the make table query. There is no selection critera specified. Has anyone had this happen? and Do you know a solution?
I'm building a make-table query for which if the result is null (no record correspond to the set of criterias), a default message like "there was no activity during the period" would appear in the table (not a message box...I need the message in the output table). The best I could think of is an IIF function but it doesn't seem to work... Is there any way to do this without using VBA?
I have what is probably a stupid question but I've been struggling with this one for a while. I have an ordering database which has an Orders table (containing Order ID, Date, Supplier etc) and an Order Line table within which I have a combo box for Product name, supplier, price, VAT rate, Line price etc. At the moment, I have the order line table as a subform within the Order form (run from the Orders table). The problem I'm having is the subtotal and total fields. At the moment these are in the Order Line table as I cannot figure out how to get these in the Orders table. In summary, can I make a calculated field in one table that calculates values from another table (linked by Order ID)?
Dim str As String str = "select combination from tbl_userinformation where Username= txtuser.value AND actualdate=txtdate.value ; " If DCount("*", "tbl_userinformation", " [05-Henrichpiramid]=true AND " & _ "Username = '" & Me![txtuser] & _ "' AND [actualdate] = " & Format(Me![txtdate], "#mm/dd/yyyy#")) > 0 Then DoCmd.RunSQL (" update tbl_userinformation SET combination = str &'05-Henrichpiramid' where Username= txtuser.value AND actualdate=txtdate.value ;")
but when i run it it asks me for enter parameter value for str
I have a User Defined Type which stores an array..I have 2 instances of this UDT, one storing matched data, the other storing exception data..I was to parse these arrays to an Excel output routine. However, the parameter variable contains no data when accessing it..
Here is my code:
Code: Private Type TOutputRow RACFID As String FullName As String Access As String LastLoggedIn As Date End Type
Hi, I have a problem, I have a table were I list networkservices and their logical ports and I have another table were I list IPaddresses used by different machines. I'm using a multivalued lookupfield to pick which services I'm using for each Ipaddress, and thats working fine, but now I want to make the ports which is listed in another column, to automatically show in it's own column in the IPaddresses table depending on which services I'm choosing for the different IPaddresses. Is this possible?, and if it is how can I make this happen?
I wanted to know if it is possible to change the name of the Table which is going to be created using a Make-Table Query via code (VBA).
For example if my Make-Table query currently creates a table with the name "Table1" I want to change it to name "Table2" and then change it Back to "Table1" or "Table3" etc.... depending on the users selection.
I am working on a query and currently I am not getting an error, but I am getting a parameter undefined pop-up when I try to run the query. The parameter it doesn't understand is really a field value that I am trying to interrogate.
NewKeyShip is one of 5 choices for the Key Order Type field. I am trying to have the system input a field value in SW Key when NewKeyShip is the selected value. I should mention that the rest of the code works perfectly starting with "If Order Form Details, part Number is like "H40." and through the end. It is only the first part that is not working well.
[code] Sw key: IIf([tbl_OrderForm].[KeyOrderType]=[NEWKEYSHIP],[tbl_OrderForm].[NewKeyNumber],IIf([tbl_OrderFormDetailsNew].[PartNumber] Like "H40*",IIf([tbl_OrderForm].[AlohaKey]>0 And [tbl_OrderForm].[NewKeyNumber] Is Null,[tbl_OrderForm].[AlohaKey],IIf([tbl_OrderForm].[NewKeyNumber]>0,[tbl_OrderForm].[NewKeyNumber],''))))
I am wondering if there is a was to know if a specific field in a query has a parameter. The reason I am wanting to know this is because I have a form with a combo box that lists all queries (query names) and would like to add a subform which would show the relevant text box's for those parameters.I am planning on showing/hiding each text box with as if statment that ends with .visable = true/false.
lets say for example the query ("qryTest") has 3 fields FirstName, LastName, Age with Age having the parameter forms!menu!age>=21. i would only like visable the text box for "Age" on the subform and have the other fields invisable.I think I can work out the coding for everything i need apart from the initial vba to work out if the query field has a parameter.
I'm trying to update a SQL table using a form button, and getting an "Enter Parameter Value" textbox prompt when the value is already declared. Not sure what is wrong. I know the value is valid as I'm returning it in a MsgBox.
Here is my code.
Code: Private Sub cmd_data_merge_Click() finish = [finish].Value conv = DDEInitiate("EXCEL", "123 Staff List.xls") For x = 4 To finish cell_employee_number = "R" & x & "C9" cell_surname = "R" & x & "C8"
I'm trying to the following sub to automate the creation of RecordSets but I'm confuse how to get it done properly.
Public Sub OpenRecordSet(SQLString As String, NameRecordset As Object) Set NameRecordset = New ADODB.Recordset NameRecordset.Open SQLString, adOpenStatic, adLockOptimistic
I want to pass the name of the recordset as a parameter but I don't know how to set it.