473,668 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to design a query with 2 tables that have date fields?

I need to create a query from 3 tables (client, work and accts recv). The client table has the unique id. The work table has wrkdte and the accounts receiveable has ardte. How can I pull the work within a certain time period along with payments within the same time period?
Nov 5 '10 #1
1 2331
Have I made this sound too complicated or just plain confusing.
Here is the sql view if this could possibly help. I'm looking for an answer with in a day or 2.
SELECT dbo_WIP.Whours, dbo_WIP.Wbilled , dbo_WIP.Wwrupdn , dbo_Clients.Clt name, dbo_WIP.Winvdat e, dbo_AcctsRec.AR Amt, dbo_AcctsRec.AR Date, dbo_AcctsRec.AR Type
FROM dbo_AcctsRec, ((dbo_WIP INNER JOIN dbo_Clients ON dbo_WIP.WCltID = dbo_Clients.ID) INNER JOIN dbo_Employee ON dbo_WIP.WempID = dbo_Employee.ID ) INNER JOIN dbo_ServiceCode s ON dbo_WIP.WCodeSe r = dbo_ServiceCode s.SCCodeDetail
WHERE (((dbo_WIP.Winv date) Between #1/1/2009# And #12/31/2009#) AND ((dbo_AcctsRec. ARDate) Between #1/1/2009# And #12/31/2009#) AND ((dbo_AcctsRec. ARType)=4));
Nov 8 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
3204
by: Gleep | last post by:
sorry i didn't explain it correctly before my table is like this example fields: ID name username outcome date1 date2 date3 (etc..) - date15 price1 price2 price3 (etc..) I know that Mysql query order by will compare records on a specific date, but how do i compare multiple fields within the same record. Want to find the latest date within the record..
9
2921
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with a device. The definition of the table is as follows: CREATE TABLE devicedata ( device_id int NOT NULL REFERENCES devices(id), -- id in the device
2
2995
by: henryopinion | last post by:
Please help. I've been ramming my head on my keyboard from trying to figure this problem out. In a query, I have two tables. One of the tables (table 1) has a unique identifier and other fields regarding the characteristics of that record. In the other table (table 2), I have another list of unique identifiers only. All unique identifiers in this table (table 2)are contained in the first table. My goal is to exclude any records that
1
3594
by: Riley DeWiley | last post by:
I have an UPDATE query that is always setting 0 records. When I cut and paste the SQL into Access and use it, it fails in the same way unless I coerce the date fields to be '=now()', in which case it works. I never get errors, and if I don't try to update the date fields, I always update the expected number of rows (1). When I do date conversion using the same conversion function, then call CRowset::Add() to add a record to the same table,...
9
2901
by: Jimbo | last post by:
Hello, I have a user request to build a form in an Access database where the user can check off specific fields to pull in a query. For example, let's say I have 10 fields in a table. The user wants to be able to check off anywhere between 1 and all 10 fields in a form and have it return a select query with just the fields that were checked off. There are multiple users, so not all users will be checking off the same fields. Some...
3
9291
by: Reader | last post by:
Hello all, I am joining two tables in a query and the output should be all those records where two fields in table1 match two corresponding fields in table2. I joined the tables using both fields in design view and the Select statement in SQL view looks good. The query runs perfectly and shows the result I want but when I save the query and close it, re-opening in design view shows the error message "Microsoft Office Access can't
1
1920
by: Rick | last post by:
I'm trying to do a SELECT statement looking for a DATE_COMPLETED field which is blank, meaning it has not been completed. The DATE_COMPLETED field is a DATE type field. How do I specify my WHERE conditiion to restrict the results to only those records which have no DATE_COMPLETED data in them? Thanks in advance, Rick
4
1633
by: sroussie | last post by:
Hi, I have spent a few days on this problem and it is driving me nuts. I have two tables called Parcels and Assessments. Both tables have two fields Printkey and SWIS. I have to join the fields based on the Printkey field plus the SWIS field being equal between the two tables. The SQL statment kind of works but does not grab all the records it is supposed to. It is a homework question but I just need to be pointed in the right direction....
8
6400
by: Ragbrai | last post by:
Howdy All, I have a query that is used for filtering results to be used in a combo box. The query needs to test fields from both a table and then unbound text boxes on the form that also contains the combo box. The fields I am working with are date fields that are formated as Short Date. I have written an IIF statement and placed it within the Criteria section of the Date field that I am trying to filter by. The current IIF statement works...
2
4180
by: jennwilson | last post by:
I am trying to generate a report based on a query that will list any records where an individual has a date listed that matches the specified time for one or both of the date fields. The two fields are danpdate and testdate. SELECT PatientDemo.PatientType, PatientDemo.ClinicianName, PatientDemo.ClientName, PatientDemo.DOB, PatientDemo.FacilityName, PatientDemo.PrimaryInsurance, PatientDemo.SecondaryInsurance,...
0
8462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8381
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8797
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8656
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5681
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2791
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.