Query Cannot Retrieve Enough Fields

Feb 7, 2007

I'm trying to build a form based on a query to use for data editing/entry purposes.

The only way I can think of to do this is to use a query to get data that is particular to my specified customer.

The first problem I have run into is that one query does not contain enough fields to retreive all the fields in my table.

I figure, perhaps I have made a flaw in my design and shouldn't go further with this until I verify it to be true. I don't think I've made a flaw, but the fact that a query has limited maximum number of fields leads me to think I might have.

Each record in the table I'm querying contains several pieces of numerical data that might be recorded during a service visit.

Obviously I could query the table twice but that doesn't feel like the right way to go about it.

View Replies


ADVERTISEMENT

Retrieve Figure Using Query?

Jun 14, 2007

Hi,

i have got a database which consists of table, queries, forms and reports.
I have one problem now is that I wan to do a query that will be able to bring the figure from another field to the current one.
ok say i have got Ref_No, Event_Date, Balance_BF, Adjustment, Balance.

so if say this is the first event for this particular ref_no (1234) it will bring the amount from another table (Principle_Table) linking the same ref_no (1234) to the Balance_BF fields,
If this is not the first event for this particular ref_no (1234) it will then bring the amount from the previous event Balance field to the current event Balance_BF field.

I am very lost how to do this. Is there a way doing this using query?

This is wat i mean
Ref No Event Date Balance_BFAdjustment Balance
06/00014 31-May-06 115140-5,757.00 $109,383.00
06/00014 31-Aug-06 109383-5,757.00 $103,626.00
06/00014 30-Nov-06 103626-5,757.00 $97,869.00
06/00014 28-Feb-07 97869-5,757.00 $92,112.00

U can see that the Balance_BF is actually brought down figure from the previous Balance starting from the second events. For the first event, the Balance_BF is actually draw down from another table (Principles_Table)

Is there a way to do this using query?

View 4 Replies View Related

Retrieve Query Parameter?

Oct 19, 2005

I have a query and using a [text string] as criteria in the Design Window - when the query runs, entering the appropriate search string retrieves the appropriate results. I have created a form using this query as the recordsource - and as such the user is asked for the string before the form loads and the results are displayed.

Is it possible to retrieve the string the user entered and display this value on the form?

View 2 Replies View Related

Query - Retrieve A Set Number Of Records

Nov 4, 2005

Hi all,

I want to retrieve a set number of records from a table, using a query. I'm not sure of how to do this.

I can't use the ID, because the table gets its data replaced contantly by imports (so the ID doesn;t start at 1...)

I want to be able to retrieve, say, the first 25 records on that table.

Any help is appreciated

View 2 Replies View Related

Need Helps On Query Retrieve Range Of Dates

Apr 18, 2007

4/11/2007 1:01:28 AM
4/12/2007 2:02:52 AM
4/13/2007 4:21:30 AM
4/14/2007 2:22:21 AM
4/15/2007 3:34:53 AM
4/16/2007 4:02:37 AM
4/17/2007 5:03:15 AM
4/18/2007 7:17:34 AM

I need some helps
I have a table with date + time, how can I query so that it retrieve a 7 days range from today and go back ti 7 days

i though this should work (it works if the the table has date only no time)
Between Date() And DateAdd("d",-7,Date())

thanks

View 2 Replies View Related

Query Design To Retrieve Required Input

Apr 27, 2007

I have been asked to create a database in Access 2000 that will hold 1.6 million postcodes. There will be four fields within the a table one holding the postcodes, and three fields holding information as to whether or not the post code is classed as good, neutral or bad. The requirements are to allow a user to run a query that asks thenm for the required postcode and then displays the relevant information (good,bad,neutral).

There requirement is that the search is done as fast as possible returning the required results. Has anybody got any ideas as to the best way of doing this.

View 2 Replies View Related

Queries :: Retrieve Data From A Table From SQL Query

Feb 21, 2014

How to retrieve data from a table (via query) ? I created the below query, but I'm not sure what else is needed to retrieve the value from my SQL query. My query code is below. I'm not getting any errors.

Dim strClient As String
strClient = "Jerry Davis"
strSQL = " SELECT [Progress Tracking].[Client Name], [Progress Tracking].[Client Start Date],
[Progress Tracking].[Start Body Weight], [Progress Tracking].[Tracking Date]
FROM [Progress Tracking]
WHERE [Progress Tracking].[Client Name])= ' " & strClient & " ' "
MsgBox "Weight Box " & " " & strSQL

View 12 Replies View Related

Queries :: How To Retrieve Column Data Using SQL Query

Apr 14, 2014

I'm trying to retrieve data based on the contents of one column.

Sample table

Code:
Description EID Basecode
----------- ---- ---------
ssdad 1001 S2378797
gfd 1002 S1164478
gfdsffsdf 1003 R1165778
ssdad 1004 M0007867
gfd 1005 N7765111
gfdsffsdf 1006 W5464111
gfd 1005 N7765111
gfdsffsdf 1006 A4000011
gfdsffsdf 1006 W5464111
ssdad 1001 2378797
gfd 1002 1164478
ssdad 1001 965000
gfd 1002 780000
yjgk 4456 540000
kjhkh 2009 150000
ddd 1004 1040
d88jg 1004 14C676
fsa 6565 158
fdh 1004 2Khlm
ggdg 2009 967

I'm retrieving all **Basecode** column data starts with only letters other than 'W', 'N' by this query

Code:
SELECT tbl1.EID,tbl1.Description,tabl1.Basecode FROM tbl1 WHERE Not
IsNumeric(Left(Basecode,1)) AND Left(Basecode,1) Not In ("W","N");

And retrieving all **Basecode** if column data length >6 and with numbers '96', '78','54','15' by this query

Code:
SELECT tbl1.EID,tbl1.Description,tabl1.Basecode FROM tbl1
WHERE (((Len([Basecode]))>6)AND ((Left([Basecode],2))='15')) OR
(((Len([Basecode]))>6) AND ((Left([Basecode],2))='54')) OR
(((Len([Basecode]))>6) AND ((Left([Basecode],2))='78')) OR
(((Len([Basecode]))>6) AND ((Left([Basecode],2))='96'));

How do i get other data which won't retrieve based on above queries, other than data mentioned on these queries like this

Code:
Description EID Basecode
----------- ---- ---------

ssdad 1001 2378797
gfd 1002 1164478
ddd 1004 1040
d88jg 1004 14C676
fsa 6565 158
fdh 1004 2Khlm
ggdg 2009 967

Third query not working

Code:
SELECT tbl1.EID,tbl1.Description,tabl1.Basecode FROM tbl1
WHERE (IsNumeric(Left(Basecode,1)) AND Left(Basecode,1) Not In ("W","N"))
AND NOT (((Len([Basecode]))>6)AND ((Left([Basecode],2))='15')) OR
(((Len([Basecode]))>6) AND ((Left([Basecode],2))='54')) OR
(((Len([Basecode]))>6) AND ((Left([Basecode],2))='78')) OR
(((Len([Basecode]))>6) AND ((Left([Basecode],2))='96'));

View 5 Replies View Related

Creating A Query That Will Retrieve Different Data From Different Records?

Mar 17, 2014

I am trying to create a Database that will type our orders. I have a table with our customer list that includes both billing and shipping information. The problem is that sometimes one customer will request a "drop shipment" to another customer. Is it possible to retrieve different data from two different customers? Billing info for customer "A" and shipping info for customer "B" without creating seperate tables?

View 1 Replies View Related

Queries :: Can Retrieve Value Of User-defined Type In A Query

Aug 19, 2013

Is there a way to retrieve the value of a user-defined type in a query?

Here's the type:

Code:
Public Type ClassRank
Rank As Integer
ClassCount As Integer
End Type

I have a function with the following excerpt:

Code:
Function GetRank(strDOD) as ClassRank
...
GetRank.Rank = intRank
GetRank.ClassCount = intCount
...
End Function

In my query I expected to be able to put the following:

Code:
GetRank(strDOD).Rank & " " & GetRank(strDOD).ClassCount

However, Access didn't like the period in .Rank or .ClassCount.

Should I just write two different function to get 'rank' and 'classcount'?

View 2 Replies View Related

Modules & VBA :: Retrieve Data From Excel And Load It To Query

Aug 12, 2015

Current situation is that I have this form with a chart.

Row Source :

Code:
SELECT PolyWrongRegInsCount.[INSTITUTION], PolyWrongRegInsCount.[NO_OF_GROUP]
FROM PolyWrongRegInsCount;

PolyWrongRegInsCount; <- This table is one of the queries that I created.However, the data is manually added. I want to get the data from excel spreadsheet. And load into my queries

View 2 Replies View Related

Forms :: Retrieve Info From Another Query - Higher Column Numbers?

Aug 22, 2014

When I attempt to use the me.field = me.combobox.column() method to retrieve info from another query,it only works if I use column 0 or 1... it doesn't work with higher columns number.

- field name: cbofi
- row source: listado-unico-fi <-- it is a query with unique values and 7 fields in total
- event procedure, change:

Private Sub cbofi_Change()
Me.txtDOCTPT = Me.cboFI.Column(1)
Me.campovia = Me.cboFI.Column(5)
End Sub

- txtDOCTPT is the field that indeed works
- campovia is the one that does not work

I tried using column(0) and column(1) and it worked fine... but higher column numbers do not work. Just mentioning because the field names are all right.

View 3 Replies View Related

Reports :: Use 1st Query To Populate Fields Then Use 2nd Query To Filter Fields

Apr 30, 2013

Any way in report that I have 2 reference queries just 1 is to populate all details and 2nd query to filter details and will be the final reporting information???

View 5 Replies View Related

Forms :: Total Query - Count Of Fields Based On Data In Other Fields

Jun 28, 2015

I have a query that creates counts of fields based on the data in other fields, basically it tells me that in a table there are two entries with value ABC????? and three of DEF????? , the query works perfectly.

When I create a form to display this data and base the form on the Query I keep getting a message box asking for the ID (key field) from the base table.

If I type * in the box (to denote all values) and press enter I get the results expected.

View 4 Replies View Related

How To Retrieve A Value From An SQL Statement

Nov 9, 2005

hi there,

I have a form called frmOrganisation with a text field name called txtOrganisationID, and tables tblES and tblOrganisation

now I need to execute an SQL Query

Set rst = New ADODB.Recordset
Dim strsql As String
Dim strsqlInt As Interger

rst.CursorLocation = adUseClient

strqry = "SELECT Organisation_id from tblES WHERE Organisation_id = " & Me.Organisation_id.Value & ";"

rst.Open strqry, CurrentProject.Connection

' i tried DoCmd.RunSQL <strqry> and CurrentDb.Execute <strsql> with no luck...

' i need to get the value from strqry and then pass it to an interger variable, any idea guys?

strsqlInt = strqry ( i need to cast/convert the result to int)
rst.Close


Thanks in advanced guys.... im stucked...

WinXP+Access2000

View 1 Replies View Related

Retrieve My Db Password

Apr 10, 2006

Hi,
I have secured my db with password. I want to know the technique/technology so that i can read my password. Access must be storing the password in an encrypted form in any password file. My idea is that if I know the file where its stored and in what form then I hope it can be retrieved.
I find so many available sites who claims that they have their product which is able to retrieve access db passowrd. I want to learn on how to do the same.
Any idea or suggestions is highly appreciated.
Thanks.

View 2 Replies View Related

Retrieve Data

Dec 22, 2006

Hi,

I create the table1 in SQL Server and then link the table to MS Access using ODBC. But, when I write do this statement
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("Select * from table1")

for i = 1 to rs.recordcount
msgbox rs.field(0)
next i

It only retrieve 1 record only, but the table have 10 records.
What's wrong with it?
I check rs.recordcount, it only loop one time.

Additionally,
it doesn't work this function in the ODBC link table
rs.addnew
rs.field(0) = "hello"
rs.update

And, when we use ODBC link tables,
we cannot delete data in the table.
currentdb.execute "delete * from table1"

it will give out error message, the table is read-only.

Please let me know about it, thanks.

View 3 Replies View Related

Retrieve Info.

Mar 21, 2007

Hi,

Suppose I have sharing drive, let's say "\server1sharefolderDatabasesdb1.mdb"

if I run this CurrentProject.Path inside the database file, it will retreive the current path with drive letter, but how can I retreive the server, and sharefolder information?

View 1 Replies View Related

Forms :: How To Retrieve First Name

Oct 13, 2014

I am able to get the user name of the computer using a function. The function returns the user name in this format: first Name.last name. I wish to display only the first name ( the name before the dot. ) in a text box. I think I can use the len function. How to retrieve only the first name. I also wish to capitalize the first letter.

View 2 Replies View Related

Using SQL In VBA To Retrieve Data?

Aug 24, 2015

i want to retrieve some data from a table i have pieced together a bit of code but get an error to few parameters.

Code:

Dim db As dao.Database
Dim Lrs As dao.Recordset
Dim LSQL As String
Dim Lname As String
'Open connection to current Access database
Set db = CurrentDb()

[code]....

when i paste the SQL into a query it works fine

View 8 Replies View Related

Retrieve AutoNumber Problem

Sep 22, 2005

Can someone please tell me what I'm doing wrong here. I have just added a record to a table. I would now like to get the record number (FamilyID), which as an AutoNumber field, and pass it to another form. My query is giving me an error that says,
"A RunSQL action requires an argument consisting of an SQL statement."

Here is the code snippet:
DoCmd.RunSQL "SELECT FamilyID FROM Families WHERE LastName = '" & _
txtLast.Value & "';"

Thanks,
Lisa

P.S. No one ever replies to my posts. Please respond if you can help. :)

View 7 Replies View Related

Retrieve Previuos Record

Mar 19, 2006

Hello,
Please tell me if there is a way to retrieve a value from a field in the previous form record in a query that don't have ID (autonumber), using data/time ascending.The function PrevRecVal() from QrySampl can only be used for query that include ID.
Thanks

View 8 Replies View Related

Trying To Retrieve A Date Between Two Dates

Apr 28, 2006

Thanks in advance

Searched birthday in threads and couldn't figure this out.

I have a select query and I am trying to retrieve a birthday that is between two dates.

This is how I set up my expressions:

chkBirthDay: Format([BirthDay],"m/d")

Criteria for chkBirthDay Between Format([LaneDate]-3,"m/d") And Format([LaneDate]+3,"m/d"

So if LaneDate = 9/7/2005 I should be able to retrieve all of the Birthdays that fall within 9/4 and 9/10. Correct?

I do retrieve records but they are dates such as 9/17/1921 and 9/18/1948 but of course they do not satisfy the criteria. There is a date in the table that does, 9/7/1981, but that record does not show up?

Any suggestions?

View 3 Replies View Related

Retrieve Specific Contacts

Aug 10, 2006

Hey Everybody,

I have 2 tables, one called [Addresses] and the other called [2006_Contacts]. The table [Addresses] has a number of various fields relating to contact data of people. The [2006_Contact] table has 2 fields [Last Name] and [First Name]. I want to run a query that pulls the contact data from the main [Addresses] table, but only if the contact name ([First Name] and [Last Name]) are present in the table [2006_Contacts].

Does anyone have any suggestions?

Thanks,
Chris C.

View 4 Replies View Related

Cannot Retrieve Unique Records

Mar 14, 2006

:confused:

I have been working on a normalized db for the past few months and it works wonderfully. But now I need to find a way to create a form so that the rest of the company can update their data.

My Table has the 5 following fields. Also listed is an example of the types of data I have there

StoreID_Catagory_Customer Year_Month_MixPercentage
IN00001_Japanese_____2005_____Jul_______.01______
IN00001_Japanese_____2005_____Aug______.02______
IN00001_Japanese_____2005_____Sep______.01______
IN00001_Chinese______2005_____Jul_______.35______
IN00001_Chinese______2005_____Aug______.25______
IN00001_Chinese______2005_____Sep______.26______
IN00001_Japanese_____2006_____Jul_______.01______
IN00001_Japanese_____2006_____Aug______.02______
IN00001_Japanese_____2006_____Sep______.01______
IN00001_Chinese______2006_____Jul_______.35______
IN00001_Chinese______2006_____Aug______.25______
IN00001_Chinese______2006_____Sep______.26______

As you can see I have multiple StoreID's for one store, IN00001. My db goes up to IN00419 so it ends up displaying 29,664 records. There are 4 different categories (Japanese, Chinese, Local, and Other). Until now everything has been taken from a datasheet and put into an Update Query but now that other people have to quickly access the system I need a slick interface.

What I need is a way to have a form that can update the table and add new entries that looks like this in the form:

IN00001____2005________Jul__Aug__Sep__Nov__Dec__EC T.
Japanese MixPercentage__.01___.02__.01___.03__.01
Chinese Mix Percentage___.35___.25__.26___.33__.30
Local Mix Percentage_____.60___.70__.69___.62__.65
Other Mix Percentage_____.04___.03__.04___.02__.04

IN00001____2006________Jul__Aug__Sep__Nov__Dec__EC T.
Japanese MixPercentage__.01___.02__.01___.03__.01
Chinese Mix Percentage___.35___.25__.26___.33__.30
Local Mix Percentage_____.60___.70__.69___.62__.65
Other Mix Percentage_____.04___.03__.04___.02__.04

I hope this gives you a clearer picture. I need to be able to update 96 entries at a time (12months, 4 customer types, 2 years) but do it in an efficient manner. The table only has 5 fields so I need to figure out how to display multiple entries on the same form. I also need a way to add new entries. In other words for me to add another StoreID such as IN00420 then I would have to enter in a value for every field for 96 records in the table. When in reality I should only need to update the mix percentages since the months and years remain constant. HELP!!

Any help would be much appreciated. Due to the variable nature of the db I cannot establish very many one-to-one relationships. So therein lies another problem.

View 3 Replies View Related

Search And Retrieve Problem

Dec 8, 2006

a form should open when a record in a listbox is double clicked.. the form doesnt open.. and when i open it independantly i am unable to edit any of the fields.the form is based on a multi table query.if anyone can suggest why it doesnt work i would be most grateful.2003 version on my webspace cos it didnt fit by 100k or something..

View 2 Replies View Related







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