Queries :: Create Query To List Hires By Customer Age Group

Jan 24, 2014

I am doing my project to create data base for Video Hire shop. Was allright so far; however hit the wall now.
I need to create query to list Hires(rentals) by customer age group. I have created query with the following fields: Customer ID, date (Date()), DOB field and calculating field: AgeGroup:Now()-[DOB]. When click to display data in AgeGroup field is displayed in days. How to set it up to display decades not number of days days?

View Replies


ADVERTISEMENT

Group By Customer And List A Field

Apr 28, 2008

Hi all,

I have a data set such as:

CustomerIDCompanyNameSiteNameStrataIDRUID
4002Severn Trent Water LimitedFRANKLEY3~00074832
4003Severn Trent Water LimitedFRANKLEY3~00074831

I would like to only have 1 record of the Company name/ID with the RUIDs listed almost in one record something like...

CustomerIDCompanyNameSiteNameStrataIDRUID
4002Severn Trent Water LimitedFRANKLEY3~00074832, ~00074831

Can we do this in SQL? (Specifically and Append query)

Thanks for any suggestions.

View 3 Replies View Related

General :: Create Check On A Field (customer ID) Of Customer Table In MS Access?

Sep 7, 2012

create a check on a feild(customer id) of customer table in MS Access , as "Customer ID is of 8 characters, the first 4 are alphabets and the last 4 are digits"

View 6 Replies View Related

Queries :: Create A Query That Will List All Items

Dec 1, 2014

I have the following tables:

tblOrderDetailsKeyItemIdOrder QtyPO#001A204001002B204001003C304001

tblTransactionsKeyTransDateItemIDReceivedPO#0011/1/2014A1040010021/2/2014B2040010031/3/2014A54001

I also have a table that list the items and on that table the column ItemID is the key.I want to create a query that will list all items ordered on a PO# and how many have been received so far. With that I will calculate the outstanding qty. I want to see:

qryOutstandingPOPO#Item IDOrder QtyReceivedOutstanding4001A201554001B202004001C30030

But all I see is this:

qryOutstandingPOPO#Item IDOrder QtyReceivedOutstanding4001A201554001B20200

It is missing item C because I have not received any yet so there are no records in the Transactions table for it to select.

View 4 Replies View Related

Queries :: List Latest In Each Group

Mar 23, 2013

I have a table of SOPs/WIs. Each, with time, gets a new version - this I keep in the child table.

tblVersions
------------
VersionID (PK)
SOPID(FK)
Version (integer)
IssueDate (date)

I want to make a list of the currently valid versions, i.e. for each SOPID pick the VersionID with the latest date.

One can do many things with subqueries and Max - functions, but after some experimentation I have stumbled upon this:

Code:
SELECT Last(tblTest.VersionID) AS LastOfVersionID
FROM tblTest
WHERE (((tblTest.IssueDate)<Date()-10))
GROUP BY tblTest.SOPID;

The function Last has a bit tricky reputation and description on the web. It does yields the right result in my testcase though , see the attached db - run query3.

Query3

Code:
LastOfVersionID
100
90
20
40
666
888
55
8

Update:
Well, it isn't. Just changing the VersionID numbers to something other than an ascending sequence renders an incorrect result with the above query. So what is the best way to get the desired result? (Access 2007)

View 4 Replies View Related

Queries :: Getting Latest Record For A Particular Customer Number Using MS SQL Query

Jul 27, 2013

My table appears like this with the following columns:

Name| CUSTNo| ORderNo.| AcctDate| OrderDate| OrderDescription

I would like to write a ms-sql query to return the records of each customer number with the latest OrderDate. One more thing, if the customer has two separate order numbers on the same date(should be the latest date), the query should be able to pull up both the records.

I tried with the code below but its taking a long time to execute and finally hanging up MS ACCESS.

SELECT * FROM TableName AS a WHERE Not Exists (SELECT *
FROM TableName b WHERE b.CUSTNo = a.CUSTNo AND b.OrderDate >= a.OrderDate);

View 2 Replies View Related

Forms :: Create A Unique Customer ID

Apr 4, 2013

So I have this field in a form/table called "CustomerID". This is to be an ID number for our customers that includes the first four letters of their last name (LastName field) followed by four digits.

This ID is created when a button is pressed in the form. After that, code needs to grab the first four letters of the last name (LastName field in the form and table) and then go to the Contacts table and see if there is already a CustomerID that starts with those four letters. If there is not, then the CustomerID will be those four letters followed by "0001". If there is, it needs to be those four letter followed by the next number sequence that still does not exist for those four letters.

For example:
First four letters of last name = zabo
Check to see if those four letters exist in CustomerID returns negative then
CustomerID assigned = zabo0001

Another example:
First four letters of last name = zabo
Check to see if those four letters exist in CustomerID returns zabo0001 and zabo002 then
CustomerID assigned = zabo0003

View 7 Replies View Related

Customer Drop Down List

Mar 21, 2006

Hey guys, I have a question that I am hoping you can point me in the right direction on. Before I ask it, I am new to access. I have been looking at templates and reading and things on how to build a database. I have my tables setup, relationships I think are right and my form created. One of the things I am having trouble with is creating a drop down list to be able to pick a customer name for. I setup the combo box and have a customerID as the control source in the properties. I have the Row Source Type as table/query and the Row Source query setup so it takes the info from the customer table.

query:

field: customer.* name
table: customer customer

I think I am doing this the same way the templates have the properties but for some reason it won't allow me to pick from the list. It keeps saying "control can't be edited. It's bound to unknown field 'CustomerID'".

I attached my database. I hope it is clear enough that you might see what I have done wrong. Thanks in advance.

View 8 Replies View Related

Modules & VBA :: Create New Counter On Customer Form For Each Day

Apr 6, 2015

I need Create a new counter on my Customer form for each day, using an Autonumber and print it

View 6 Replies View Related

Create New Table With Unique Customer Rows

Mar 6, 2014

I am trying to take a table that looks like this:

Customer Name
Fruit

Customer A
Apples

Customer A
Bananas

Customer B
Pears

Customer B
Apples

Customer C
Pears

And create a table that looks like this:

Customer Name
Apples
Bananas
Pears

Customer A
Apples
Bananas

Customer B
Apples
Pears

Customer C
Pears

I think this is relatively simple but don't know the syntax to create this table.

View 2 Replies View Related

Forms :: List All Records With Same Customer Name

Sep 11, 2013

Is there a way (via the form) to search for all the records that have the same customer name and have that list show up so the user can select the exact record s/he needs?

View 14 Replies View Related

General :: Create Invoice Per Month Of Multiple Orders Per Customer?

Mar 19, 2013

My current database creates an invoice per order. Until now that worked wonderful. Now i want to create an invoice per month per customer with multiple orders on the same database. So i will have to create a new table/query on the existing order table.

View 1 Replies View Related

Updating Email Address In Customer List

Jul 5, 2006

I need to keep a customer list and I need to update the email address of the existing customers in the customer list.

The customer list table called 'masterlist' and the table looks like this:

IDPhone CallerNameContactEmail
112345678Emily Office<blank>
287654321Emily Home<blank>
399536546Emily Mobile<blank>
4 75293924 Jack <j.k@mail.com>

The table contains email address of some of the existing customers, I have the same fields in this table, the table called 'Newemail'.

IDPhone CallerNameContact Email
112345678Emily Officec1@mail.com
287654321Emily Home<blank>
399536546Emily Mobilee1@mail.com
478954648Jenny <blank>
545454854Derek <blank>
645484542Kelvin k1@mail.com

How I can insert the email address from 'Newemail' into my existing customer list 'masterlist' i.e. contact email of ID 1 and 3 :confused: ? I would like to ignore ID 4-5 from the 'Newemail' table. And I would like to keep ID 4 from the 'masterlist' table.

Thanks!! :D

View 6 Replies View Related

RecordsetClone Problem On Northwind's Customer Phone List

Feb 16, 2006

When attempting to select a letter in a form copied from the Northwind's Customer Phone List Form, I am now getting an error message that says "The object doesn't contain the Automation object "RecordsetClone'".
I never had that problem before.
Appears to be something in the Option Group that has gone awry, but I cannot access the Visual Basics behind the Macro.
Is there a way to suppress this message? It does not appear to be a problem in bringing up the sought after page.
:confused: :confused: Please help!!

View 1 Replies View Related

General :: Remove Customer From List But Keep All Related Info

Sep 26, 2012

Let's say I have a list of customers. For each customer I have much more info on other lists (order list, personal info list, bank info list, and so on) - all are of course connected properly.

Now let's say a certain customer is no longer my customer, so I want to remove him from the customer-list. But, I want to move him to a different list - past-customers - so all the information that was related to that customer will remain so. In short, I want to remove from the customer-list without affecting the related data.

View 4 Replies View Related

Queries :: Using Variable In A List Field Query - Getting Complete List On Initial View

Mar 28, 2014

In my access form I provide the user a list of locations from various countries in a listbox . But the list is too long so I provide him a combobox for selecting a country. Selecting the country should update the listbox showing only the locations in that specific country.

So my SELECT from the listbox must cover the unselected state and show all entries and when a country is selected it must narrow the selection.

I tried to get this happen with the following SELECT statement containing a variable. Choosing a country in the Combobox results in a change of the variable and in a requery. This works after the first country is selected and for each country change, but the initial list is empty.

VBA in the loadform
'Application.TempVars.Add "varcountryselect", "*"
SELECT in the listbox "lstlocationsperproject"
SELECT tbllocations.locationID, tbllocations.country, tbllocations.localstreet, tbllocations.localcity FROM tbllocations WHERE ((tbllocations.country) Like [TempVar]![varcountryselect]);

VBA in the combobox
Application.TempVars("varcountryselect") = [Form]![kombcountryselect].Column(0)
Me.lstlocationsperproject.Requery

The values in [kombcountryselect].Column(0) are texts like "SPAIN", "MEXICO", etc.

Any hints, how I have to use the * for getting the complete list on the initial view ?

View 5 Replies View Related

Customer Discount To Product Discount Group

Mar 22, 2007

Hi I'm hoping someone can help me with this problem (the access problem.. not the other one ! :cool: ) I have a table of Products, each item belongs to a product group, I have a table of Customers, amoungst the normal customer fields I have fields named after the item discount groups so that each customer has his own discount for that group of products... when I enter an item into the sales order form I would like the discount for that customer for that item(item group) to go into the discount box.. sounds easy if you say it fast... I hope someone can help me with this !

View 8 Replies View Related

Queries :: Group By Function In A Query

Apr 8, 2014

I'm having trouble using the "group by" function in my query. The option in design view is not showing up and I'm not able to figure out what I'm doing wrong. What is there in design view is Field, Table, Sort, Show, Criteria, Or. I seem to be missing the "Totals" option.

View 2 Replies View Related

Queries :: Query Group By Hours

Aug 10, 2014

I have a table with a list of records, each record has a timeFrom this I have a query, what I would like the query to do, is group the records in the query by hours.

View 1 Replies View Related

Queries :: Union Query - Group By Then Sum

Aug 5, 2013

I have a Union Query which the result was like this:

Date Cash_In Cash_Out
08/06/2013 100.00
08/06/2013 25.00
08/06/2013 50.00
08/06/2013 20.00

Note: The Date Field comes from two different tables. Original field names are Cash_In_Date and Cash_Out_Date.

View 5 Replies View Related

Add Customer Name Into Table Each Time Unique Customer Added To SaleTable

Dec 11, 2013

I have a Table Sales - that lists customer and order information

Most of the customers are new - is there a way to populate Customer Name Table with a new entry each time a new customer is input into the Sales Tale

(Without having to add the custome to Customer Name Table - then going to Sales Order)
OR
Failing that - is there a way to use a list box that points to Customer Name Table (and if it doesn't find the one you want, will allow you toadd a new record) In the SAME form as you use to add to Sales Table.

So:
Date (textbox linking to form.Sales) Customer Name (List Box linking to form.CustomerName + adding the info to form.Sale)

View 6 Replies View Related

Create A Randomise List From A Table And Save The List For Each Month

Dec 14, 2006

Hi All a newbie here so any help will be appreciated,

sorry for the long post but trying to give you all the information you might need.

I wrote a basic access database for my Church to aid in a paperwork audit for a charity food drop which we do monthly to give free food to the needy.

But each month it gets harder to find out who was in line first so I thought with all your help we may be able to randomize the names each month in a different order as to avoid confusion and also avoid people waiting in line as they turn up at 5am and we don't start until 9am.

So if this will work in access they can all come for 9am

I don't mind creating a new database and adding the additional information, if that's what it would take.

My Background I have created basic databases from scratch not using wizards, But I don't know much about code or how to implement it so any help in where code goes it would be very much appreciated.

Database details (Microsoft Access 2002 version)

Table Name = details
Field name = ID (auto-generated)
Field name = FirstName (text)
Field name = Surname (text)

If possible it would be nice to keep a record of the randomized lists (in the database somewhere ?) each month in case anyone wants to see it or disputes the lists, where I can just create a report to show the details.

There will be approximately 90 to 125 names.

Thank you in advance for all your help in this matter

Britgent

View 1 Replies View Related

Queries :: Query Group By And Display Other Columns

Sep 2, 2013

I have a table with 4 columns :

Product Price Quantity Supplier

Product1 5 240 A
Product1 7 19 B
Product1 6 12 C
Product2 96 0 A
Product2 98 23 B
Product2 99 44 C

There are 3 suppliers for the products (name of the suppliers are A, B and C).I want to make a query with the following result :

Product1 5 240 A
Product2 98 23 B

In other words :Showing a grouped list (grouped by products), with the lowest price of the supplier who has stock (quantity >0).I can make a list of grouped products with the lowest price, but it's not possible for me to show the stock and the supplier that's related with it.

View 2 Replies View Related

Queries :: Duplicate Count From Group By Query

Jul 17, 2014

I'm trying to count the number of records within a region range using a lookup table however I keep getting duplicate values, SQL code, what is happening:

SELECT Count([summary].Key) AS CountKey
FROM Summary, lookup
WHERE ([Region])) Between [Region 1] And [Region 2]));

View 4 Replies View Related

Queries :: Dataset - Group By Query Without Summing

Jan 15, 2015

I have a a dataset that has recorded encounters with a number of Banded (identified) animals. It is currently setup so that each encounter is its own row; with all the information, including "Band_Num" repeated, but "Encounter_Date" being unique. I wanted to query the table and get it to display the results as "Band_Num" on a row, followed by x columns for with each unique "Encounter_Date" represented. I thought a "Group By" function would work, but that requires a sum, which is not useful.

Complicating this is the fact that not every individual is seen a set number of times, so Animal 1 might be seen 3 different dates, but Animal 2 only on 1 date.

View 4 Replies View Related

Queries :: Running Count Over Group In Query

Feb 2, 2015

I have an access query named "leaveapp" and I want a running count as below:

EmpID TypeID
360 1
360 1
360 14
360 14
360 8
1390 8
1390 8
1390 14
1390 14
1390 1

and i need a column in the right with running count like below

EmpID TypeID runningcount
360 1 1
360 1 2
360 14 1
360 14 2
360 8 1
1390 8 1
1390 8 2
1390 14 1
1390 14 2
1390 1 1

View 3 Replies View Related







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