A Query With Multiple Steps In Sequence

Jun 27, 2006

Is there a way to make a query that has several steps that have to be run in sequence, rather than all at the same time?

For example, I want to create a table that is created from 3 other tables that I download.

The first step would be to append all titles from the first downloaded table, not allowing duplicates.

The second step would be to append all titles from the second downloaded table, not allowing duplicates.

And the same with the third step.

It would be nice to be able to do this with one query, but since it gives me an error because I am trying to do the same thing three times to the same field, I can't. I would really like to avoid having to save this as three different queries, like I've had to do with other multi-step queries.

If there's a way to do this, I'll be able to apply it to several other multi-step queries I have.

Also, if that is possible, is it also possible to have several types of queries in one? Like an append query with several update queries, performed in sequence?

(Note: I'm creating these queries in Design View--I don't know enough to write my own queries in sql, except for my one union query--which I had help with--from here, I think. I can, and often do, alter sql queries that others have written for my own purposes, though.)

Thanks,
Siena

View Replies


ADVERTISEMENT

Multiple Aggregates With Fewest Possible Steps?

Jul 18, 2005

Hi,

I have a table wherein only new data is provided by the user, and fields that have not changed from the previous record are left Null:
Date Field1 Field2
1 B (Null)
2 A 1
3 (Null) 2

Is there a simple way to produce the following results from an aggregate query:
Date Field1 Field2
3 A 2

(Where [Date] is a parameter.)

Right now my process is pretty clumsy, requiring multiple steps to get the MaxOfDate for each Field, then each Field's value corresponding to its MaxOfDate. Not pretty. :(

View 3 Replies View Related

Too Many Steps?

Oct 10, 2007

I am working with several reports between Access and Excel and I feel like there must be an easier way to do what I need. Hoping someone can help.

I have 4 Excel files, A.xls and B.xls and C.xls. Each with different fields that I will use to join and extract data to make D.xls.

A is the master file that I need to compare B and C to. I need to create a 4th file that will contain all the records on A and only those on B & C that match A. I am using email and ID as the join fields. A has email, B has email and ID, C has ID. I am joining A & B by email to make query A_B which contains all A records and only those on B that have same email. A_B now has fields email and ID. Then I need to use query A_B to join to C. The problem here is that I cannot use the query A_B to do this. I get an error message and have to export the query to Excel then bring it back into Access as another table to use for the last join. This is where I feel like I am doing an extra step. Is there a way to use this last query for the next join so I can end up with a final file that has all A records that contain B data and C data?

I know this sounds confusing but I hope someone can understand and provide guidance. Thanks!

View 5 Replies View Related

Time Steps And Actual Dates

Feb 29, 2008

Hi,

This is my first post here and I seem to like the activity on this forums. Now to my issue.

I have a table with schedules: Event and it's schedule in actual date:

Ex.
Event1 1/1/2007
Event2 5/1/2007
Event3 7/1/2007 (MM/DD/YYYY)

and I have another table which has the event name, time steps and numbers:

Ex.

Event1 1 1000
Event1 2 1500
Event1 3 1500
Event1 4 2000
Event1 5 1500
Event2 1 1000
Event2 2 1500
Event2 3 1500
Event2 4 2000
Event2 5 1500
Event3 1 1000
Event3 2 1500
Event3 3 1500
Event3 4 2000
Event3 5 1500 (I kept the numbers same for all, time steps are monthly)

Now, I can't think of away to write a query to link the dates and the time steps, eventually reaching to some output as this:

Event1 1/1/2007 1000
Event1 2/1/2007 1500
Event1 3/1/2007 1500
Event1 4/1/2007 2000
Event1 5/1/2007 1500
Event2 5/1/2007 1000
Event2 6/1/2007 1500
Event2 7/1/2007 1500
Event2 8/1/2007 2000
Event2 9/1/2007 1500
Event3 7/1/2007 1000
Event3 8/1/2007 1500
Event3 9/1/2007 1500
Event3 10/1/2007 2000
Event3 11/1/2007 1500

Thanks, let me know if there is anything not clear. Pointing me to the right direction to do this helps a lot since I am kinda lost.

View 3 Replies View Related

Queries :: Saving Export Steps Access 2003

Nov 4, 2013

MS Office 2003..I have 7 queries that I use to export data to one excel workbook. Inside the workbook are 7 worksheets, one for each query. I have it working but I dont know how to save the exports steps like I did in AC2010.

I export the data by right clicking on each query and select export , then I browse to the workbook and because each query is named differently , it names the worksheet. I have to run these 7 queries each month , so I would like to save the steps and then build a macro that would run all seven steps at the push of a button.

I have saved the steps on a PC running MS office 2010 and the macro works great. The problem is this resides on a PC that cant be upgraded and I need to make it work on Access 2003 .

View 1 Replies View Related

Textbox To Display Percent Of Steps Completed On A Form

Sep 17, 2014

I'm enrolling medical centers in a new multi-center database. There are a number of steps that must be completed before the center is enrolled in the project. I have a form that serves as a checklist. I want the textbox at the bottom of the form to display the percentage of steps completed. I guess you would have to count the number of fields on the form that are filled in, but I don't know how to do it.

View 1 Replies View Related

Adding Sequence Number To A Query

Apr 3, 2007

I have a query that captures date values from a table based on a between function that works fine. What I would like to do is associate a sequence number fro each date value returned and either perform a make table or leave it as a select query. If I create a table I know that I aam able to add an autonumber field but the query is executed frequently and performing the addition of the autonumber field is not feesible. Any thoughts how I can generate the sequence number each time the query is executed?

Thanks

View 3 Replies View Related

Insert Sequence Number In Query

Nov 12, 2013

I would like to insert a sequence number into a query that currently returns 7367 rows.

Here's what it looks like now:

ID_NUM
DTE_FIN_TRANS_RCV

1322
9/27/2012

1322
7/10/2012

1011
7/2/1999

1011
9/22/1999

1011
10/21/1999

Here's the desired outcome with sequences:

ID_NUM
DTE_FIN_TRANS_RCV
SEQUENCE

1322
9/27/2012
1

1322
7/10/2012
2

1011
7/2/1999
1

1011
9/22/1999
2

1011
10/21/1999
3

All I need is a way to number rows with a value higher than the previous for that particular ID_NUM.

View 4 Replies View Related

Generate Record Number Sequence In Query?

Mar 23, 2006

Hi -

Suppose I have a generic query that returns a group of records.

Is there some way to generate a field containing the number sequence of each record? E.g. if there are 10 records, generate the numbers 1 through 10?

Must be a simple way to do this, I'm just a bit dense today...

Thanks,

-g

View 1 Replies View Related

Modules & VBA :: Sequence Number In Query Use A Starting Number

Sep 20, 2014

creating sequence number in a query using a starting number. For example i want to use the starting sequence number as 5

---SEQNUM---------COLOR-----------
-----5------------------blue--------------
-----6------------------red---------------
-----7------------------orange-----------
-----8------------------black-------------

View 2 Replies View Related

Sequence

May 25, 2006

I have duplicate loan numbers in a table. I want to create a query that will assign a number so the the duplicates will have a new field called sequence.
example

LNNUM SEQ
999999 5
999999 4
999999 3
999999 2
999999 1
888888 3
888888 2
888888 1
777777 2
777777 1

Any suggestions?

View 2 Replies View Related

Dates Not In Sequence

Mar 20, 2007

Hi all,

I have encountered some issues with the dates.
For e.g, Jan-06, Feb-06, April-06, May-06
Is there any way to determine that Mar-06 is missing from the list. The listing will be growing.

Cause I need to have a culmulative counter so Jan-06 to Feb-06 will be counted as 2. But if there is a break in between, in this case, Mar-06, the counter will be set to 0, so for Apr-06, the counter will be 1.

Have been troubled by this issue for a long time, I appreciate all help given, thanks!

View 3 Replies View Related

Record Sequence....

Apr 4, 2007

Hi... i have a excel file..... from which i have imported records.... after importing.... the records sequence in my table has changed..... can anyone tell me how to preserve the sequence that i had in excel..........

View 3 Replies View Related

Sorting Sequence

Jan 21, 2008

Hi there,

Not sure whether I am in the right forum. It is Table, Form and Query.

Have a table which index to sort on 4 fields - Proj, SubProj, Team, SubTeam.

1. I used this Table on a form, the data seems to be in random sequence instead of above.

2. Then I tried to sort it in a query which showed up fine ( as required) in the actual running of the query. However when I used this query in a form, the data doesn't sort as expected.

3. With above 1 and 2, I have also tried the Order Of in the Form properties which still do not do the trick.

can anyone shed somelight on this please.

BTW, After I first created the form, I just rename the record source in form property. Don't know whether this make any differences in the above result.

View 9 Replies View Related

Incorrect Collating Sequence

Oct 27, 2005

I tried this question a few weeks ago, but I'm trying again.

I have 2 Access 2002 files. One has a sort order of ascii and one has a sort order of international. I need them to both have the same sort order. It doesn't matter which one. Right now I get the above error message on one of them.

How can I change the sort order so that I can import Paradox files like I used to?
:eek:

View 11 Replies View Related

Autonumber Column Not In Sequence

Aug 15, 2007

Hi,
Its good to be back after a long time. Hope everyones fine.
I have a query and would appreciate any help.

I have a master-table (tblM) and two related tables (tbl1, tbl2) with one-to-one relation.

Relation1 : tblM.ID (autonumber) related to tbl1.caseID (number;LongInteger)
Relation2 : tblM.ID (autonumber) related to tbl2.caseID (number;LongInteger)

Relations are cascaded (referential integrity imposed).

I import data from excel and feed fields of tblM (I dont feed ID field from excel as it generates autonumber). At a time I feed 150 records (daily).

I have a front-end based on query from three underlying tables. Data-entry-operators do not work on tblM data as it is readonly in the front-end. They enter data in the tbl1 and tbl2 columns.

I noticed as they start entering data in tbl1 columns, the tbl1.caseID column gets data from tblM.ID on its own. Same happens in the case of tbl2.

My observation is :
I find that tblM.ID is not equal to the number of records available in tblM. (ie tblM.ID is more/less than number of records in the table. So the tblM.ID generated is not in serial.

Next time as I start importing data from excel file to tblM it gives me error and not allowing further import.

Any help!

Thanks and regards,
Prodigy.

View 5 Replies View Related

Conditionally Numbered Sequence

Aug 29, 2006

Hi,

I have a table with 400,000 (approx) records in the following format:

a(PK:AutoNum) - b(text)-c(text)-d(Num)-e(text) - f (text - unique/random)
A B C D E F
1 - 6767 - P2 - 1 - 24/992 - 34341212
2 - 6767 - P2 - 1 - 24/993 - 87657483
3 - 6767 - P2 - 1 - 24/995 - 98764536
4 - 6767 - P2 - 2 - 24/996 - 87543297
5 - 6767 - P2 - 2 - 24/998 - 98674635
6 - 6767 - P2 - 2 - 24/999 - 34546576
7 - 6767 - P2 - 2 - 25/001 - 98768547
8 - 6767 - P2 - 2 - 25/002 - 46576897
9 - 6767 - P2 - 2 - 25/004 - 62536475

I need to create a new field in a query that acts like an autonumber, that resets based on an increase in field (d).

ie:

1 - 6767 - P2 - 1 - 24/992 - 34341212 - 1
2 - 6767 - P2 - 1 - 24/993 - 87657483 - 2
3 - 6767 - P2 - 1 - 24/995 - 98764536 - 3
4 - 6767 - P2 - 2 - 24/996 - 87543297 - 1
5 - 6767 - P2 - 2 - 24/998 - 98674635 - 2
6 - 6767 - P2 - 2 - 24/999 - 34546576 - 3
7 - 6767 - P2 - 2 - 25/001 - 98768547 - 4
8 - 6767 - P2 - 2 - 25/002 - 46576897 - 5
9 - 6767 - P2 - 2 - 25/004 - 62536475 - 6

I initially thought I could make an IIF expression that basically says: if [d] in this row is the same as [d] in the previous row then add 1 to the previous record [new number], otherwise, enter 1 in this record [new number] (thereby resetting it)....

I have searched the forums for 'numbered sequences' (amongst other things), and it appears that either the Dcount or Dmax function appear to be the solution, but I'm having some trouble applying it to this problem. I was hoping someone can help me through it.

Cheers

View 1 Replies View Related

Function Sequence Error

Oct 30, 2007

I'm running an update query and I get this error - Function Sequence Error. (#0)

I have an excel spreadsheet that I imported into a table. I am trying to update the part table with date from the spreadsheet. The part id is unique and thats how the tables are joined. I only need to update 5 fields. The table I'm trying to update is a linked table.

I can't figure out what I need to do to make the necessary updates.

View 1 Replies View Related

Adding Numbers In Sequence

Dec 30, 2013

I work for a non profit agency, and we offer a Representative Payee service (paying bills for those who can't handle their own money). I've created a database that keeps track of everyone's finances, and gives us all the reports we need. The only thing I have not been able to do is to actually print the checks.

I have a report that pulls up the data (in check format ... including making $1.00 say one dollar and 00/100). But I'm stuck trying to give the checks a check number. I can't figure out how to pick a number to start with, and then add numbers sequentially.

View 6 Replies View Related

Custom Record Deletion Sequence

Aug 7, 2007

I want to create a custom sequence when deleting a record but I'm having a problem.

What I want to do is prompt the user for the reason he/she is deleting the record and then archive this so it can be viewed in a log at a later time. This extra step is not as easy as I thought it would be.

What I did was put some coding into the On Delete event of the form. The code opens a form with a text box. The user can enter the reason for the delete in the text box and click OK or click cancel to abort the deletion.

My problem here is opening another form from the On Delete event. As soon as the form is open, the code just passes to the next step of the sequence and deletes the record.

There are 2 approaches that I've thought of but I'm not happy with either.

Approach 1:
In the On Delete event, set Cancel to True. That way the deletion is not handled by the delete sequence but rather by the new form that opens. The problem is that deleting a record from another form is not that simple. What I've tried is to execute a SQL statement that grabs the ID of the record from the open form and delete it. The problem is that although the record is deleted, all the fields on the form say #Deleted in them which is not that pretty. (Maybe there's some other way to do the deletion without this problem that I'm not aware of...?)

Approach 2:
Use an Inputbox. Unlike a custom form, the Inputbox delays execution of the code so the code can determine from the results (i.e. should it cancel the delete if the user clicked Cancel). The problem with Inputboxes is that they are not very flexible in the layout, they look pretty "packaged" (i.e. they look to me like the programmer didn't bother creating a means to enter a value). There's no way to place the buttons where you want or have it do better validation (e.g. I want the FORM to check that there's at least a few words describing why the user is deleting the invoice rather than have the form with the record get the input message passed back and then give an error and then pop open the Inputbox again)

I think that especially when you're creating an application with anything financial, you'll want to log a deleted invoice including the date, amount, possibly the client's name, invoice number, reason for deletion and the login name of the person doing the deletion. All of these are easy to record other than the reason.

Help would be much appreciated.

SHADOW

View 5 Replies View Related

Sequence Break In Key Number Field

Mar 30, 2006

Hi!

1. If accidently a record or two in a sequence are deleted, how will you know that this has happened! What type of validation can be enforcedto prevent this?

2. How do you make your Tables, Quries, Forms, Reports, Macro tamper proof?

Please help!

Orsonros

View 2 Replies View Related

Numbering Sequence/Autonumber Problem...

Jun 7, 2006

I need to create a button that generates a sequential four digit requisition number and places that number in a field along with some text. I cannot use autonumber because this number is not and cannot be the primary key. In addition, I need to be able to reset the number to 0001 at the beginning of each federal fiscal year. Here are the details:

reqtype: An option group that has these choices: PC, TL, and RQ
actionyear: A drop down box that lists the current fiscal year: 2007
reqnumber: A field that, when the button is clicked, combines a text prefix, reqtype, and actionyear with a four digit sequential number.

The end result should look like this: SEC-07-PC0010 and be recorded in the reqnumber field.

My code writing abilities are limited. Could someone please help me out. Thanks.

View 1 Replies View Related

Printing Sequence Of Access Report

Sep 6, 2004

Hi,

I have 2 single-page Access reports. The first report has the following fields:
FirstName, LastName, StreetName, HomeNumber. The second report has the following fields:
MerchantA, MerchantB, MerchantC.

The data for the first report are taken from tblBuyers, the data for the second report are taken from tblMerchandise.

I need to print 2 copies of the first report and 4 copies of the second report for the first Buyer, then 2 copies of the first report and 4 copies of the second report for the second Buyer and so on. Can I help on this problem ?
Rgds

View 1 Replies View Related

Finding Missing Numbers In A Sequence

Feb 1, 2005

Hello, I have no idea what to search for to see if someone else has already asked this question. I've tried several things with no luck. So here goes...

I work in a library. We deal with thousands of journal subscriptions--we cancel our subscriptions and order new journals all of the time. Every paper journal we have is assigned a unique number, called a ZP number. When we throw out a journal, that ZP number can be assigned to a new journal.

I would like to find the earliest missing number in the sequence without having to check manually. Is there a way I can do a query or something to find missing numbers in the sequence? The ZP numbers start with 1 and go up to 9999.

So, I have two fields: Title and ZP#.

How can I do this?

This is a cloned table, used solely for assigning ZP#'s, so it can be altered in any way--including adding records with blank titles for each missing number.

Thanks,
Siena

View 8 Replies View Related

Returning Data For A Set 13 Period Sequence

Jul 2, 2005

Hi guys
Well Im stuck!

I have to produce a report (preview first)that acts like a cross tab query. By this is mean that it reports specific data in a 12 period sequence for each year. Therefore I have to set up dates which are NOT normal calendar dates ie one could be 02/05/05 to 29/05/05 then the next would be 30/06/05 to 24/07/05

These dates are issues at the start of a contract year. I have to therefore produce the report for each period that is given to me ( not an easy one is it) I have considered many options but I cant quite get the final effect

Any Ideas ??

gareth

View 4 Replies View Related

Finding Numbers Missing In Sequence

May 8, 2007

Hi

I've searched the forum and only found one thread which covers this but doesn't help me.

I have a table with peoples individual information in it.

Every person has a unique ID number.

I want to find the missing ID numbers when I delete a person so I can keep the numbers in sequence.

I am not using autonumber. The reason for this is coloured wristbands. Each wristband has a unique number and they are broken into 4 colours. each colour has a number range 1 - 300, 301 - 600, 601 - 900, 901 - 1200. Each person in the table has to have an ID number matching a wristband. The people are also broken into 4 colour categories. This means that not every range is filled before i need to start using the next range.

Hope that makes sense.

Snab

View 7 Replies View Related







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