Query From Multiple Tables Using Date Input

Feb 22, 2008

I have 3 tables, "Customer", "Offsite Service" and "Service".

Customer:
ID
Last Name
First Name
...

Service:
ID
Date
Price
Trans#

Offsite Service:
ID
Date
Price
Trans#

All 3tables are joined by the ID#.

I need to create a sales report/query based on the results of the user input, which is a date range. I've got it working great with two of the tables, but not the third. Here's the code for the working one I have now. I had to add the Trans# to make sure it returned all the results. If I take it out it only shows a small percentage of the records. The Trans# is NOT the same on both the service tables.

This pulls the information from "Customer" and "Service" tables and returns
Last Name - First Name - Date(Based on user input) - Price

SELECT [Customer List].[Last Name], [Customer List].[First Name], First([Service Records].Date) AS [First Of Date], Sum([Service Records].Price) AS Price
FROM [Customer List] INNER JOIN [Service Records] ON [Customer List].ID = [Service Records].ID
GROUP BY [Customer List].[Last Name], [Customer List].[First Name], [Service Records].[Trans #]
HAVING (((First([Service Records].Date))>=["Start Date" Use format MM/DD/YY] And (First([Service Records].Date))<["End Date" Use format: MM/DD/YY]))
ORDER BY [Customer List].[Last Name];

This pulls the information from "Customer" and "Offsite Service" tables and returns
Last Name - First Name - Date(Based on user input) - Price

SELECT [Customer List].[Last Name], [Customer List].[First Name], First([Offsite Service Records].Date) AS FirstOfDate, Sum([Offsite Service Records].Price) AS SumOfPrice
FROM [Customer List] INNER JOIN [Offsite Service Records] ON [Customer List].ID = [Offsite Service Records].ID
GROUP BY [Customer List].[Last Name], [Customer List].[First Name], [Offsite Service Records].[Trans #]
HAVING (((First([Offsite Service Records].Date))>=["Start Date" Use format MM/DD/YY] And (First([Offsite Service Records].Date))<["End Date" Use format: MM/DD/YY]))
ORDER BY [Customer List].[Last Name];



I want to be able to pull records from a date range that returns customer name, the date and price from service AND the price from offsite service.This way I have the price from both tables that I can add up and get a total sales report.

And yes I'm an access dummy, so please keep your directions easy for me to understand. Thank you in advance.
Bill

View Replies


ADVERTISEMENT

Query With Specific Date From Multiple Tables

Dec 19, 2005

I am trying to pull just a specific date that a Claim was sent to be processed. But the query has 40 tables that it needs to go through to get all possible dates. I know you will all say this is over kill on the tables, but each table represent a travel claim.

The problem I have is that I get to the 10th claim and it stops pulling the date. I put the following statement in the criteria:

[Type the beginning date MM/DD/YYYY]

any ideas?

View 14 Replies View Related

Data Input Form From Multiple Tables

Nov 4, 2004

Hi, I have a big problem. Here is the business rule, I am trying to track meeging request(MR) made. A meeting request is made by a manager,MR can include many analysts, and MR involves 1 project. I need to generate several reports from the MR information so I am trying to make sure the info is inputed correctly. I am trying to creat an input form for the MR table (tblMR) The input form is going to contain all the fields from the tblMR except the manager_ID and and the Project_ID, I am also going to have it track which analysts attended the meeting(1 or more). The problem I am having is in creating the form but having the analyst, manager, project values come from their own tables but after selecting them through combo box or list box, for values of Manager_ID and Project_ID to be entered in the tblMR. And for the analyst involved to be stored in a a composit table called tblMR-Analyst. this table will help me track how many meeting each analyst has been to. Any suggestions will help.

View 2 Replies View Related

Forms :: Subform With Date Picker To Input Multiple Dates

May 14, 2013

On my main form, I have a subform to input multiple dates, using date picker.

I also have a text box on the main form to input single dates, again using Date Picker.

On entering both the single date text box and the subform, I don't want the (default) date to be visible. I only want the date to be visible once I have selected a date from the Date Picker.

I have figured out how to do this with the single date text box. I have simply defaulted the forecolor to be white so that you can't see the font against the white backcolor. Then on the Change Event, I set the forecolor to be black. Works like a charm.

However... This same approach will not work with the subform. I've tried playing around with a bunch of different events, but so far nothing allows me to re-create what I am able to do with the single date text box on the main form.

View 2 Replies View Related

Forms :: Creating User Record - Input Multiple Tables From Form

Mar 28, 2015

I am building a form to create a user record and at the same time i have some yes/no options which are located in other tables but when i want add a user i cannot select any yes/no options they seem locked?

View 1 Replies View Related

Tables :: Input Mask For A General Date Field?

Feb 8, 2013

I need an input mask for a general date field. When I add the date "11/01/2012 10:00:00" it works fine.

When I add an input mask of 00/00/0000 00:00 it then doesn't work.

View 2 Replies View Related

Forms :: Input Data Into Multiple Tables Using Single Form - MS Access 2013

Jan 15, 2015

I have 5 tables that I would like to input data in. It can only be done with a single form. The fields I want to input in have the same names in all 5 tables, for example:

Table 1:
Name
Age
DOB

Table 2:
Name
Age
DOB

Table 3:
Name
Age
DOB

Table 4:
Name
Age
DOB

Table 5:
Name
Age
DOB

Is it possible to input data into all of these fields in each table using one textbox for each field?

Preferably without having to use code but if it cannot be done without it then that would be fine.

View 7 Replies View Related

Tables :: Appointment Date - Table Input Mask Error

Mar 28, 2015

I Have a field called appointment date and i have set the input mask as short date 00:00;0;_

the data type for the field is date/time but for some annoying reason this error message appear when I enter a date to the table... which for example is written like this 01/03/2003

I've attached the msg below ....

View 3 Replies View Related

Tables :: Date Input Mask - Copy And Paste Into Preformatted Table

Aug 25, 2014

I have an excel spreadsheet i want to copy and paste into a pre-formatted table, and the excel date format is integer YYYYMMDD or today is 20140825

I can't get the input mask in MS Access 2007 to create that !

View 2 Replies View Related

Date Input Mask In Query?

Sep 1, 2012

We have employee dates of birth in our database. For a birthday gift exchange program, I want to generate a query that returns only the day and the month of the employee birthday (to placate those employees who wish not to disclose their exact age). I'm struggling with making a custom date input mask that will do this.

View 3 Replies View Related

Query Criteria Based On An Input Date

Oct 2, 2006

I have a database with the following information:

FTA # Date Attended Last name First name assigned person......

Each week I need to generate a report that shows the people that attended for that week, grouped by the assigned person. I only want to show the data for a specific "date attended" (i.e. that days date). I figured I first need to generate a query that only returns the data for that specific date in the "date attended" column. I did that but it is manuel by using the criteria field.

Is there an easy way to type in the date that I want the query to use as the criteria?

Thanks
:o

View 14 Replies View Related

Append Query, Multiple Tables To Multiple Tables In Another Database

Nov 29, 2007

Can a Append Query move all my data stored in multiple tables to another database with a identical table structure?

Because as I try to work the query, I keep getting prompted to "Select a table" I want to append to, and I don't want to append to just one table...

View 4 Replies View Related

Parameter (Date) Query To Get Input Dates On Report?

Apr 28, 2006

I have a report that has an underlying query that asks for Start Date and End Date.

Is there anyway that I can get what the user inputs into the box to be put into the Page header of the report?

ie: user enters into the parameters
[Start Date] 01/01/2006
[End Date] 04/04/2006

Then when the report displays it says

Report for the period 01/01/2006 to 04/04/2006

Thank you for your time

View 4 Replies View Related

Multiple Fields Of Multiple Tables To One Table Query Or Report

Apr 12, 2013

I have 10 tables, 30+ fields on each table (every table has the same 'account number' field). I only need from 5 - 20 fields from each table. How do I get the certain fields from each table and put them in a table, query or report?

View 1 Replies View Related

Querying Same Date Parameter From Multiple Tables

Apr 21, 2008

During a client's stay with our agency, they are served among multiple contracts and are placed within multiple programs. Because clients move frequently between contracts and between programs, we have separate tables which have start and end date fields. It is common for any client to have multiple listings in these two tables, but with different event dates.

I am struggling to create a query that will capture each client's most CURRENT contract AND program. In the future, I'll want to create a parameter query that will allow the end user to enter a range of dates and capture all of the contract and program movement during a period of time.

Any suggestions?

View 4 Replies View Related

Tables :: Database With Multiple Entries For A Single Date?

May 17, 2013

We have two facilities that receive four different types of shipments. I wanted to set up a database to track these shipments. Is there a way for me to set up tables such that the person entering the information can leverage the same date and location field for each entry type? For example, we may only receive two types of shipments today and four tomorrow. I want to avoid having the clerk enter the date and location two times today and four times tomorrow for each data entry.

Here's an example of what I mean above:

Date Location Type Qty
5/16 1 A 10
5/16 1 B 1
5/17 1 A 1,000
5/17 1 B 100
5/17 1 C 1
5/17 1 D 11

I'd like for the clerk to select from a fixed number of locations (1 and 2) and a fixed number of types (A, B, C, or D) and provide the date and quantity received.

View 4 Replies View Related

Input Date By Picking Date From Calender

Jun 14, 2005

I am not a professional programer but would like to do a simple database for my group to track research progress. Is that possible to "pick up a date from drop down calendar" then the date will input to the cell (save in table) in a form, instead of typing it in? I saw that in lots of web sites, but can not figure it out how to do it in Access. Tried "Canendar Contol" and "LANDesk Data control" in the toolbox.

Thank in advance

PK

View 4 Replies View Related

Between Date Query/multiple Fields

Nov 13, 2006

Hi! My question is similar to Hondasteed earlier today but a little different. I have a database that has 6 date fields. I would like to develop a query where the user enters a start and end date and the query checks all six of those fields for the appropriate dates and shows only those records who have dates in that range. The dates would change each month as we ran the query again. I would appreciate any help as this has really had me stuck and I'm guessing it's a simple solution. Thanks!

View 6 Replies View Related

Tables :: Automate Record Input Across Tables

Jan 13, 2015

Trying to get a record entered into a field on table (a) to automatically enter into same field on table (b).Example: Plant database table, input record in plant name field. Have same record appear in propagation table in the plant name field.Played around with relationships a bit, don't know if there is where u do this.Plant name is primary in both tables.

View 1 Replies View Related

Multiple Tables And 1 Query

Apr 24, 2005

Hello all:

I have multiple tables in my access db, the structure of the tables (4 in all) are exactly the same except that the billing dates are for year 2001 to 2004 i.e. separate table for each of the years.

I don't want to copy the information in these 4 tables into 1 table because I have over 2 million rows in each table. However, I want to be able to run 1 query that will provide information from all 4 tables. E.g. filtering for billing dates between 2001 to 2004 for a particular customer.

How do I join the tables together so that I can run a query on all 4 tables at one time.

Thanks for your input.

Odun

View 2 Replies View Related

Query From Multiple Tables

Mar 31, 2006

i have an excel worksheet with 24 similar sheets : a,b,c,d, aso
the sheets contains similar data: nr, firm, invoice, sum, payment date, etc
i linked them to access creating tables : a,b,c,d, aso
i must create a query based on them to sort the data in the tables ascending by the due payment date (query based on multiple tables)

i've done this for 2 tables:

SELECT *
FROM a, b
WHERE (((a.SCADENTA)<=[due payment date]) And ((b.SCADENTA)<=[due payment date]));

but it multiplies the data by 2 or many times in the resulting table.
what is wrong?

View 3 Replies View Related

Query On Multiple Tables

May 31, 2007

Here is a some what complicated question dealing with queries.

I have several tables with data and every month I create a new table with similar data. I am trying to build a query to keep track of certain statistics with in the monthly tables. However I do not want to have to update query each month linking the tables together. What I really would like to do is have a table with the names of each of the tables, which I could up date easily, which links the query to each table to determine the statistics. If this is making any sense, I would appreciate the help.

Thanks!
Mike

View 2 Replies View Related

Multiple Input Mask

Feb 25, 2008

Hi,

Can anyone tell me how I can format my access tables with multiple input masks under one field?

In my table I have formatted my telephone numbers so that they read (xxx) xxx-xxxx which suits our predominantly UK based business telephone numbers, however we also have a lot of Irish numbers which follow a different configuration e.g. (xxxxx) xxxx-xxxx - how can I add this second input mask so that both formats are recognised within the same column/ field?

Many thanks
RHorton

View 2 Replies View Related

Modules & VBA :: Multiple Value Input Box?

Jun 12, 2014

How I could do a multiple value InputBox in VBA, if this is even possible... This is so I can prompt the end user to enter a range (with two string values as start and end parameters) for a report I'm working on.

If this is possible, I would like to include this as an additional parameter option within the code I have below:

Code:

Private Sub EmployeesBadges_Click()
Dim soa As Byte
Dim emp, sEB As String
soa = MsgBox("Do you wish to print a single employee badge or all?", vbYesNo + vbQuestion)
Select Case soa
Case vbYes

[Code] ....

I'll just create a form to do this.

View 3 Replies View Related

Query - JOIN Multiple Tables

Jun 11, 2006

Hello All;

Could someone please assist me on this?

The following is the Tables:

ContentTypes ---> Site Content Directory
Cats ---> Categories
Sierra ---> Store Content for Sierra
BrushStrokes ---> Store Content for BS

I have "tried" to create a QUERY for the 4 Tables
(The code that I have, originally came with 3-Table Query connection
I have added in the 4th Table "BrushStrokes")

This is the Query that I created. Before the code, a little insite

At first there was: RIGHT & LEFT JOIN's, But I would receive this:
Error 3258
After not really finding any good examples of how to create the
2- Queries and have then work together as one.
I decided to try something else, which was to create all [INNER JOIN]'s
Which got rid of the Error, and the code still will not work in my site.
========
Microsoft JET Database Engine error '80040e14'
Syntax error in JOIN operation.
=======

So, here is the code, please let me know what is wrong with it?
And if possible, a good example of creating the [2 - Queries] that work as one.

Thank you all
Carrzkiss
-----------------------SQL QUERY------------------
SELECT Cats.CatID, Sierra.CatID, BrushStrokes.CatID, Sierra.ContentID, BrushStrokes.BSContentID, Sierra.Product_Title, BrushStrokes.BSProduct_Name, Cats.CatDescription, Cats.CatTypeId, Sierra.Product_Th_Image, BrushStrokes.BSThumbnail, Sierra.Our_Price, BrushStrokes.BSPrice, Sierra.Retail_Price, BrushStrokes.BSRetail, Sierra.Aff_Name, BrushStrokes.Aff_Name, Sierra.Brand_Name, BrushStrokes.BSArtistName, Sierra.YAvailable, BrushStrokes.BSStatus, Sierra.Percent_Savings, Sierra.Unique_Product_ID, BrushStrokes.BSProductID, Sierra.Main_Cat, BrushStrokes.BSCol_Cat, ContentTypes.ContentType, Sierra.Product_Description, BrushStrokes.BSDescription
FROM ((ContentTypes INNER JOIN Sierra ON ContentTypes.ContentTypeID = Sierra.ContentTypeID) INNER JOIN BrushStrokes ON ContentTypes.ContentTypeID = BrushStrokes.ContentTypeID) INNER JOIN Cats ON (BrushStrokes.CatID = Cats.CatID) AND (Sierra.CatID = Cats.CatID)
WHERE (((Sierra.Display)=1) AND ((BrushStrokes.Display)=1));
-----------------------------END SQL QUERY------------------

View 3 Replies View Related

Access Multiple Tables Query

Oct 6, 2006

this is a tricky one.
Basically I have 3 tables

country
state
city

relationship:

1:m -> country:state
1:m -> state:city

I want to get all the country, state and cities. SELECT * FROM country, state, city

thats fine. But I only want to show unique values, in other words, just want to show unique country values, not duplicates. How can I do this?

View 1 Replies View Related







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