If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > How do I create a query to find past customers?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-12-12, 11:54
mobite mobite is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
Question How do I create a query to find past customers?

In my company we make custom made products for our customers from scans we store on our computer. When we get an order from a distributor for a customer we assign the the scan a number. We put the name of the customer, the name of the distributor, and the scan number in a database. We receive hundreds of new scans each month and a few reoders. Our records are divided by each year. How can I set up a query to find a previous orders by searching the customer name and have it show all the customer's information?

For example. If I searched John Smith, the results would be:

2001 John Smith Westside Distributing # 001 783
2004 John Smith Westside Distributing # 040 997
2004 John Smith Northberg Distributing # 040 567
Reply With Quote
  #2 (permalink)  
Old 01-12-12, 12:19
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
select my, column, list from mytable
where customername = 'blah'

or
select my, column, list from mytable
where customerno = 12345

you cold parameterise the query to take a value from a form control
say you had an UNBOUND combo / list box containing customers called cbCustomers
the where clause is something like

strSQL = "select my, column, list from mytable"
strSQL = strSQL & " where customerno = " & cbCustomers.value

or
strSQL = "select my, column, list from mytable"
strSQL = strSQL & " where customername = '" & cbCustomers.value & "'"
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 01-13-12, 14:13
Missinglinq Missinglinq is offline
Registered User
 
Join Date: Jun 2005
Location: Richmond, Virginia USA
Posts: 1,702
Just to clarify, when you say

"Our records are divided by each year"

you mean that each Record has a Field in which the year is stored, correct? You don't mean that you have a separate Table for each year, do you?

Linq
__________________
Hope this helps!

The Devil's in the Details!!

All posts/responses based on Access 2000/2003
Reply With Quote
  #4 (permalink)  
Old 01-17-12, 11:13
mobite mobite is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
Yes. Each year has it's own table in the database.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On