Connecting Tech Pros Worldwide Help | Site Map

Hoping someone can help with Query approach

  #1  
Old August 22nd, 2007, 07:35 PM
sara
Guest
 
Posts: n/a
Hi -

I posted this earlier and didn't get any response. Hopefully someone
can help??

I have a table keeping track of employees' jobs in a location. So,
Store #1 Manager #353, AsstMgr #556
Store #2 Manager #776, AsstMgr #132
etc.

The table is
Date StoreNum MgrNum AsstMgrNum ...


Each time a "line up" is recorded, we put in the new date (as people
come and go, for example)


I am trying to figure out how to write a query to get the "Line Up"
for all the stores.

I want the user to enter a date, and have the query return ONE record
per store, and the date on that ONE record is equal to the date the
user enters on the form, OR the nearest date prior to the date the
user enters.


So, the user could enter "1/1/2008" and get the most recent record
for
each location.


I can't get a query to do this! I have records for store 2 for 9/9/06
and 8/17/07 and I just want the 8/17/07 record and I don't have it.
Probably easy, but I'm stumped. I've tried "Max Records" but that
doesn't return the max by store.


SELECT tblLineUp.LineUpDate, tblLineUp.StoreNum
FROM tblLineUp
WHERE (((tblLineUp.LineUpDate)<=[Forms]![frmLineUpAndPhone]!
[txtLineUpDate]));


THEN I want to print these results on a report (I'll look up the
numbers and get the name). I have NO idea how to do that. What I
want is:


Store 1 Store 2.....
Mgr Joe Ken
Asst Mgr Sue John

Do I need a crosstab, or a crosstab for each "job" (manager,
assistant,
Sporting Goods, Clothing, etc.?) to get the person in the job in each
location?

Any and all help is apprecitated.


Sara

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help deleting a record from a joined query in visual basic Coll answers 1 December 10th, 2007 12:05 PM
Problems copying query results to table - novice issue Kelii answers 9 February 1st, 2007 05:35 AM
A resaonable approach to managing data? Takeadoe answers 14 July 25th, 2006 03:15 PM
Combo Box Query: Listing a subset - Revisited Robert Neville answers 1 November 12th, 2005 08:18 PM