SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL query in Access

    Okay, I have a database here at work that I'm working on, and I'm having a problem with the SQL. Maybe someone can help me. I have 2 tables called Data and tEmployee. tEmployee has a listing of all the employees in my department and Data has all the shipping information from the department. This is the SQL query.
    Code:
    SELECT Data.[Date Shipped], Data.Employee, Data.MediaRaw, Data.Quantity, Data.Docs, Data.[Disk/CD], Data.Boxes
    FROM Data, tEmployee
    WHERE (((Data.[Date Shipped]) Between [StartDate] And [EndDate]))
    ORDER BY Data.[Date Shipped];
    Now, what I am try to achieve is to create a query that, based on these 2 tables and date range input from a form, will list all the media types and quantities, Disks/CD's, Boxes, Documentation, etc grouped according to the employee. (NOTE-quantities refers to quantity of the MediaRaw field and other fields are numeric fields referrig to the quantity of the particular item) However, ALL the media does not need to be listed for each employee, just what he or she has shipped.

    This query that I posted the SQL for above produces all the orders shipped between the given dates, but it does not group by the employees and all around does not give me the sorted results I want. Am I making any sense?
    Sketch
    Aaron Brazell
    Technosailor



  2. #2
    SitePoint Evangelist CyberFuture's Avatar
    Join Date
    May 2001
    Location
    San Diego, CA
    Posts
    434
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    At first glance, I don't see a join statement. How are the two tables related to each other?

  3. #3
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmmm, good call. I hate SQL. I can't ever figure out what I'm doing.Okay, going to fix that...
    sketch
    Aaron Brazell
    Technosailor



  4. #4
    SitePoint Zealot HotDog's Avatar
    Join Date
    May 2000
    Location
    Salt Lake City, UT
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ACCESS SQL resource page

    If you have any further ACCESS SQL questions, an excellent place to find help in on the MS site itself at http://msdn.microsoft.com/library/de.../acfundsql.asp. This link goes to the Fundamentals page. At the top and bottom of the page are links to the Intermediate and Advances topics. This is an excellent source for all Jet SQL questions.
    Joe Eliason
    Just a dog learnin' PHP from cat.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •