Queries :: Change Field Name In Pass Through Query

Feb 10, 2014

In a table of a SQL-Server 2008 I have a fieldname "Alter", the German word for age.

When sending a PT-qry to the server I get an error "Incorrect syntax near the keyword 'Alter'"

Even when I try to set "Select tblmytable.Alter as Age" I get the same error.

To change the fieldname is almost impossible, as there is to much code to change.

View Replies


ADVERTISEMENT

Queries :: Pass Through Query Slow Until Change Search Criteria

May 21, 2014

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.

View 2 Replies View Related

Queries :: Change Field Format Within A Query

Sep 23, 2013

I'm having a format problem. I have a query (Q1) that, among other things format a date field as YYYYMM (Field1).

I have a second query (Q2) whose data source is Q1.

In Q2 I need to link Q1 to a table but Field1 is being reformatted as text (confirmed by running a make table query).

I want Field1 to be Number format to eliminate a mismatch error.

I know how to change the format of a field in a table using VBA but I cant seem to find a way of changing the format within a query.

View 2 Replies View Related

Queries :: Pass Through SQL To Update SQL Field

Aug 26, 2014

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.

View 3 Replies View Related

Queries :: Change Query Field Based On A Form

Oct 29, 2013

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.

View 3 Replies View Related

Queries :: Create View (Query) With Only Change In Value For First Field

Jul 16, 2014

Need sorted Query to be used in a Listbox. The attachment shows a made-up view of the objective.

The first column shows the change in value, then blanks for the first column's next rows, until there is a change of value again.

I do something like this in Excel where the first change in value is bolded. This is to make a list box more readable.

View 13 Replies View Related

Queries :: Field In Table Doesn't Change When Edited From Query

Mar 29, 2013

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?

View 2 Replies View Related

Queries :: Change Time Portion Of Datetime Field In Update Query?

Sep 12, 2013

I have some incorrect time entries in a column that I need to fix with an update query.

So, 04/11/2013 08:00:00 needs to be changed to 04/11/2013 09:00:00

View 5 Replies View Related

Queries :: How To Find The Source Of Sql Pass Through Query

Feb 13, 2014

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.

View 8 Replies View Related

Queries :: Pass Through Query Odbc Connection

Feb 24, 2014

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.

Code:
ODBC;DSN=DSNNAME;Driver=Firebird/InterBase(r) driver;Dbname=Database.FDB;CHARSET=NONE;PWD=Password;UID=User;

The reason that I would like to do this is to ensure that the user can change it easily.

View 3 Replies View Related

Pass-thru Queries - Can They Be Built As A Parameter (prompted) Query?

Feb 23, 2006

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?

Thanks in advance for any help...

View 1 Replies View Related

Queries :: Pass A Formula Form A Query To Excel

Apr 5, 2013

Access 2003
Excel 2003

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

Code:
MyCalc::"IF(T2="","0",TODAY()-T2)"

View 1 Replies View Related

Queries :: Cannot Format Data From A Pass Through Query From SQL Server

Jan 10, 2014

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

View 5 Replies View Related

Queries :: Pass Table Names To Delete Query

Aug 27, 2014

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?

View 5 Replies View Related

Queries :: Pass Through Query Results To Matrix Which Is Then Exported To Excel

Sep 5, 2013

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

[code]....

View 12 Replies View Related

Queries :: Pass TempVar To Query That Is Selected From Previously Opened Form

May 23, 2013

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]

but that doesn't work either.

View 2 Replies View Related

Queries :: Change Name Field To Display ALL CAPS

Oct 14, 2013

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

SELECT IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[First Name]),IIf(IsNull([First Name]),[Last Name],[Last Name] & ", " & [First Name])) AS [File As], IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[First Name]),IIf(IsNull([First Name]),[Last Name],[last Name] & " " & [first Name])) AS [Student Name], Students.*
FROM Students
ORDER BY IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[First Name]),IIf(IsNull([First Name]),[Last Name],[Last Name] & ", " & [First Name])), IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[First Name]),IIf(IsNull([First Name]),[Last Name],[First Name] & " " & [Last Name]));

View 4 Replies View Related

Queries :: Cannot Change Sort Order On Float Field

Apr 22, 2013

I have a query with a float/delta column which is the expression:

Code:
Float: [Date1] - [Date2]

When I try to change the order by in the column filter drop-down i get a data type mismatch in criteria expression error.

View 1 Replies View Related

Field Change Query

Apr 16, 2008

All,

Is there a way to create a query to show when text in a specific field was changed?

View 2 Replies View Related

Pass Through Queries

Jan 6, 2005

Is it possible within Access to use a pass through query that joins tables from two different servers?

If not I have a workaround solution though this is a more intensive effort.

As always, you are all great here and any help is appreciated.

View 1 Replies View Related

Change Field Facts In Query?

Oct 20, 2005

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:

Revenue in value (sold goods in $)

or

Revenue in volume (sold goods in pieces/SKUs)

??

View 3 Replies View Related

Change Field In A Query By Form

Aug 5, 2006

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.

View 2 Replies View Related

Using VBA To Change The Name Of A Field In A Union Query

Feb 16, 2007

I have a table called LLD Import Table with the following fields in it.

FileNumber, LandDescription, Qtr1, Sec1, Qtr2, Sec2, Qtr3, Sec3, Qtr4, Sec4, Qtr5, Sec5

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));

Your help would be GREATLY appreciated!

View 1 Replies View Related

Form Change A Query Field?

Jul 11, 2012

Can a form change the field on a query?

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.

View 1 Replies View Related

Queries :: Change Format On Query Criteria?

Apr 5, 2013

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?

View 8 Replies View Related

Queries :: Conditional Change To Date Query?

Feb 13, 2014

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?

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved