I have an access 2007 database connect to sql server 2008.I am running a pass though query to search between two dates (this query has been fine for years)
If I now run any search using parameters from 26th March 2014 to date - the query takes 10+ minutes to run.If I then change the date to 25th March 2014 to date - it runs in a nano second.I have not changed the back tables and I have not changed the format the data is saved in.
I have an SQL table that uses bigint on the primary key field. When I lilnk this table into Access 2010, this table is not even visible because bigint isn't recognized by Access.I have a field on this SQL table that I need to update and I was looking at using a Pass Through query in Access. I have a query in Access that creates a list of records that I need to update.
I need a query's field to change to what is selected in a combo box.
Example,
I select product 1 in the combo box on a continuous form, after the update there is a requery. The form now displays the data from product 1.
I have tried putting [forms]![form1]![combo1] into the field box of the query. But this only makes the form display "product 1" in every row, it does not take any data from the table.
Users are viewing a record on a form that gets it's data from a query. I want to make it so that if they edit that record from that form, a last updated field will timestamp the date/time that the record was edited. I added a lastupdated to the source table which of course adds it to the query and so it's on the form.
But whenever i access the form and change something, the lastupdated only shows the time the record was created (which is from a different form based directly on the table). Whenever I edit any other field data in that query based form it changes in the table. Why not the Lastupdated?
I am after getting an access 2003 database to look after and it contains SQL pass through query's. The database is a front end to a MS SQL server database with a connection string that is contained in a module.
I believe the SQL pass through queries are connecting to the same database as the rest of the application and somehow is using the connection string in the module. However I cannot find how that is configured on the SQL pass through queries.
Most documentation on the net seems to point at using ODBC to connect slq pass through queries to outside databases but I don't think this is the case. There are not Odbc sources set up for the database I am look at.
I made multiple pass through queries that receive their data via an ODBC link which is established. Currently the username and password is entered seperately in every query but I was wondering if it is possible (and how) to make both look for the values in a table (OR somewhere else if possible) for these values. The following code (with edited information) is used in all queries.
I have developed some complex pass-thru queries in Access, looking at DB2 data. I am hoping to be able to make these queries 'prompted' for easy use for my less technical colleagues. If these were developed in IBM's QMF tool, I would build the prompt like &MemberID, for example, if I wanted the user to input a value for Member ID. Access pass-thrus don't recognize this, and it throws an error. Anyone have any ideas on how I can do this?
I have a routine that exports the results of a query to an Excel file. Is it possible to input the formula into the query so that the Excel values calculate?
This is the formula I am trying to pass to the "AZ" column of the Data tab
I get a result set from a pt qry from a sql server 2008 in vba. Me.Total is an unbound field in the report foot( correct translation of german "Berichtsfu"??)
Private Sub Berichtsfu�_Print(Cancel As Integer, PrintCount As Integer) SELECT SUM((DATEPART(hour, Calctime) * 60 + DATEPART(minute, Calctime)) * Price / 60) AS TtlPrice ... Set rs = CurrentDb.OpenRecordset("qryPT_TtlPrice") Me.Total = rs("TtlPrice ")
On the access report I can format me.Total as currency, decimal, integer whatever I want (unless it makes no sense exept currency) and it works.
but
SUM(((DATEPART(hour, Calctime) * 60 + DATEPART(minute, Calctime)) * Price/ 60)* (case when CompanyID=1 then 1.66 else 1 end)) AS TtlPrice
The detail should be multiplied with 1,66 when the record belongs to company 1, for all others ist remains the same. In the Management Studio the results of both looks similar, same in the debug window of VBA editor, but I cannot format the result or lets say, the formating is wrong for the second example.
Neither in VBA Me.Total = format(rs("TtlPrice "), " 0.000,00") or Me.Total = format(rs("TtlPrice "),"0.000,00")
nor in the report int the properties of the field I can avoid this result: in the debug window of access the result looks OK, for example 29555.670000 (don't know where all the 0 come from), which should read as 29.555,67. But on the report the result with formated curreny in field property (currency, 2 decimals) shows 29.555.670.000,00
I use the following code to delete from a table all records except those meeting the WHERE criteria:
Code: DELETE tblABC.*, tblABC.SubjectID FROM tblABC WHERE (((tblABC.SubjectID)<>99 And (tblABC.SubjectID)<>432));
I'd like to run this exact same query, but on many other tables, all of which are stored in tblTablesToClean (TableID, TableName).
Any good way to have Access loop through the list of tables in tblTablesToClean, each time passing the name of the table into the DELETE code and running the code, until all tables have been processed?
I have wrote some code which calls a query using querydefs and then pulls all the records into a table. This table is then exported to excel, however I seem to be having some trouble with the export and am finding it difficult to identify where the problem is coming from. When I run my code in step by step, more of than not the code passes fine and exports to excel. However, most of the time when I run the code as a whole without step by step, then the excel application will load but the workbook will not. The application then continues to close and the code completes without error? The code for the opening of the excel file is below.
The pause is a function i created to see if it was a problem of giving the exel application some time to load!
Code:
Sub MiseEnForme1_Excel() Dim AppExcel As Excel.Application Dim WkbExcel As Excel.Workbook Dim WksExcel As Excel.Worksheet
I'm trying to create a query that supplies a form with data. I want to pass a TempVar to the query that is selected a from previously opened form.The TempVar is setting correctly and I can see if this if I place a textbox (NewCID) on the form showing the TempVar. The problem I have is displaying on the records according to that TempVar. If I set the query manually, i.e. "|Test|" then records are displayed but if I use the TempVar, which also displays |Test| then no records are brought back.
think it's something do with the vertical bar and that fact the field I'm searching on is a memo field, both of which I've no control over. I also have to use the Like statement because of this.Here's the query that works...
SELECT * FROM dbo_ASSETS WHERE ASSET_CID Like "|Test|"
and the one that I want to use, that doesn't...
SELECT * FROM dbo_ASSETS WHERE ASSET_CID Like [TempVars]![tmpvarCID]
I've even tried referring to the textbox instead of the TempVar, i.e.
SELECT * FROM dbo_ASSETS WHERE ASSET_CID Like [Forms]![AssetsCID]![NewCID]
My attendance dB has some last name in lower case and others in all caps base on user input. Is there anyway to make it consistent? Also, please there will be about 250 users scrolling through the name column for attendance. What would you recommend for the most user friendly way to display names? How to create a form that would perhaps allow a button for all last name like "A- C" member name
Lets say I have a table with the following columns:
Chainname Storenumber Storename Revenue in value (sold goods in $) Revenue in volume (sold goods in pieces or SKUs) Month
I create an Append query where I use these fields from my table:
Chainname Storenumber Storename Revenue in value (sold goods in $) Month
What happends afterwards doesn't matter, but I what if I would like to change a field in my Append query to this:
Chainname Storenumber Storename Revenue in volume (sold goods in pieces/SKUs) Month
I can do that manually by opening the Append query and then change it in the field...But can I change it without actually opening the query. Lets say using a Form were I choose if I wanna use:
Is the a way of changing the fields selected in a query by a form.
I have a form showing how many people need to do each module. Each textbox is populuted by a count from the table.
The idea is simply to avoid having 26 queries based on each module. Is there a way to have the field name changed via the form.
I have used the on dbl click event to pass the field name to a hidden field on the record. I just need to pass the data in the hidden field to the select query.
Data Example: 123456, T43 R2 W5M, S, 6 123457, T43 R1 W5M, SE, 18, SW, 17 123456, T43 R1 W5M, E, 19, E, 30, SW, 29, E, 31, NE, 18
What I have done so far is to create a Union query to create a new record with the file and land description repeating for each row where there is quarter and section data with the following code:
SELECT [LLD Import Table].[FileNumber], [LLD Import Table].[LandDescription], [LLD Import Table].Sec1 AS Section, [LLD Import Table].Qtr1 AS Quarter FROM [LLD Import Table] WHERE ((([LLD Import Table].Sec1) Is Not Null)); UNION SELECT [LLD Import Table].[FileNumber], [LLD Import Table].[LandDescription], [LLD Import Table].Sec2 AS Section, [LLD Import Table].Qtr2 AS Quarter FROM [LLD Import Table] WHERE ((([LLD Import Table].Sec2) Is Not Null)); UNION SELECT [LLD Import Table].[FileNumber], [LLD Import Table].[LandDescription], [LLD Import Table].Sec3 AS Section, [LLD Import Table].Qtr3 AS Quarter FROM [LLD Import Table] WHERE ((([LLD Import Table].Sec3) Is Not Null)); UNION SELECT [LLD Import Table].[FileNumber], [LLD Import Table].[LandDescription], [LLD Import Table].Sec4 AS Section, [LLD Import Table].Qtr4 AS Quarter FROM [LLD Import Table] WHERE ((([LLD Import Table].Sec4) Is Not Null)); UNION SELECT [LLD Import Table].[FileNumber], [LLD Import Table].[LandDescription], [LLD Import Table].Sec5 AS Section, [LLD Import Table].Qtr5 AS Quarter FROM [LLD Import Table] WHERE ((([LLD Import Table].Sec5) Is Not Null));
To give this result:
FileNumber, LandDescription, Quarter, Section 123456, T 43 R 1 W5M, NE, 18 123456, T 43 R 1 W5M, E, 19 123456, T 43 R 1 W5M, SW, 29 123456, T 43 R 1 W5M, E, 30 123456, T 43 R 1 W5M, E, 31 123456, T 43 R 2 W5M, S, 6 123457, T 43 R 1 W5M, SW, 17 123457, T 43 R 1 W5M, SE, 18
However the number of Quarters and Sections under a file changes, so next time I my table could have fields up to Qtr20 and Sec20 What I’d like to do is to create a function that will automatically change the # behind the field names (to replace the * in the example below) so that I don’t have to rewrite the Union Query each time. I’ve seen some code examples that can change the value, but don’t quite understand them enough to write one.
SELECT [LLD Import Table].[FileNumber], [LLD Import Table].[LandDescription], [LLD Import Table].Sec* AS Section, [LLD Import Table].Qtr* AS Quarter FROM [LLD Import Table] WHERE ((([LLD Import Table].Sec*) Is Not Null));
Right now one of the tables in my query has multiple years across the top (as the fields), 2010, 2011, 2012, 2013. Each year contains different rates that get applied to labor hours.
I would like to know if there is a way to have a form change the field in my query. I have attached a word document showing print screens of what I mean.
I use expression on the query field, but after I run it, the field change its format from number to text, how to reformat on the query criteria to change the text to integer format?
i need to clean up a date field (I hate dates in access!). The field in the table (imported from a spreadsheet) has records where users have simply entered a date in the correct format and then others where users feel obliged to add comments after the date rather in the 'Comments' section. Therefore Cdate alone won't work.
So far i have tried:
Code:
IIf(Len([TabDL].[PROMISE]<>10),#1/1/1900#,CDate([TabDL].[PROMISE])) AS PromiseDt1
The intention being to insert a holding date 01/01/1900 if the field contains too many characters to be a date alone. I've tried multiple variations of this code but keep getting errors across the board. Is my logic or Syntax flawed?